$_post $var - how to post as a variable

$_post $var - how to post as a variable

$_post $var - how to post as a variable

how to post $_POST[$var.$id], I wanted to create a variable that looped through a counter based on the number of fields on the form and input them into a database. I didn't always know how many fields were on the form so i created this mini script to loop through;

$nofields =$_POST['nofields']; //no of fields submitted $a=1; //counter start

while ($a<=$nofields) {
$fn="varname".$a;
$fieldname=$_POST[$fn];
echo "$fieldname";
$a=$a+1;
}
}
}

 


CAN YOU HELP


Turbo Charge your business

We put our money where our mouth is. Our mission is to help any business anywhere get back on track.

If we don't bring you new customers you pay us nothing. We take nothing up front and there is no contract. We trust you implicitly. And it is literally if you don't pay us for bringing in new customers, then we stop brining them in.

You decide how much you are willing to pay for a customer and you pay once we bring them to you.

Simple, easy nothing else to explain.

If you would like us to help you get your business or products booming email us at zigzads@gmail.com

Speak soon.