$_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;
}
}
}

HOW TO GET MORE CUSTOMERS

How to stop paying council tax 

I'm having a clear out, new things added daily

How to stop paying council tax

Stunning cushion 40cm x 40cm...

Stunning cushion 40cm x 40cm Constellations of thoughts


£24.00

Matt Handcock Pin cushion...

Matt Handcock Pin cushion


£3.99

Wine bottle gift bag/ holder...

Wine bottle gift bag/ holder linen new hand made


£3.00

Bean Bag door stop - new ...

Bean Bag door stop - new


£4.00

New Glasses Holder...

New Glasses Holder


£4.00

New Glasses Holder...

New Glasses Holder


£4.00

Stunning cushion 40cm x 40cm...

Stunning cushion 40cm x 40cm Constellations of thoughts


£24.00

Cleaner in Woking