JC99 Posted July 24, 2009 Share Posted July 24, 2009 Hello, I would like to take the values of a textfield in a form and put it into an array, then be able to display the values in that array. How would I do that. Here is my form... <form action="index.php>" method="post"> <table> <tr> <td>Option1</td> <td><input type="text" name="option[]" /></td> </tr> <tr> <td>Option2</td> <td><input type="text" name="option[]" /></td> </tr> <tr> <td></td> <td><input value=submit" name="submit" type="submit" /></td> </tr> </table> </table></form> Quote Link to comment Share on other sites More sharing options...
JC99 Posted July 24, 2009 Author Share Posted July 24, 2009 On index.php (Where the form redirects me too) I added the following... foreach ($_POST['option'] as $value) { echo "Value: $value<br />\n"; } ...and everything is working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.