I am running the following test below and entering some text into the first text box out of the 20. I am simply trying to echo out the post value in the spec.php page for further processing. When I try it echo’s nothing. My question is, how come if I generate input element code using a loop, where every input ‘name’ attribute is unique, the $_POST variable you would expect to be passed on to spec.php does not echo out?
<form action="spec.php" method="post">
<?php
for($i=0; $i < 20; $i++){
echo '<input type="text" style="border:2px solid red;" name="inp'.$i.'" />';
}
?>
<input type="submit">
spec.php
echo $_POST['inp0'];
First debug your $_POST with the following:
See if all your inputs are in there.
Edit:
I just used the following and it works!
action.php
result: