index.php:
<form action="post.php" method="POST">
<input type="text" name="option_<?php echo $i ?>" value="" />
<input type="submit" name="btnSubmit" value="submit">
</form>
The $i variable is a sequence running from 1 to $n.
post.php:
if(isset($_POST['btnSubmit']))
{
$option_name = ???;
}
How do I get the text that was posted for each option?
Why not use PHP arrays for this?
In the file it is posted to: