$_POST[] question
Posted: Thu Apr 17, 2003 11:47 pm
say i use a loop to create 20 input in a form. Each input's name is item1, item2, item3.... etc. Now i send it to a php script, how would i use a loop to read the inputs value?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Check out variable variables:valen53 wrote:" how would i use a loop to read the inputs value? "
Code: Select all
//$item_num is a variable i set in the loop to create the inputs so i have a count of inputs the loop does.
//I use the substr_replace to add $count to the end of $name getting item1 than item2 etc.
for($count=1;$count<=$item_num;$count++)
{
$name="item";
$name=substr_replace($count,$name , 0, 0);
$store_itemї$count]=$_POSTї$name];
}