You are to create a PHP program named states.php that creates a scalar value $states that will accept 5 state names from the user.
OK, I know how to make an array. That's cool. With the rest of the instructions, I know I have to move one state to position 0 and one state to position 1, so I need an array with 7 positions (0-6) Sorry, I dunno all the lingo stuff 🙂
Anyway, one page, entitled form.php, I have...
<form name="stateentry">
<input type="text" name="states[2]">
<input type="text" name="states[3]">
<input type="text" name="states[4]">
<input type="text" name="states[5]">
<input type="text" name="states[6]">
<input type="reset">
<input type="submit">
</form>
K, got the form. How do I get the form to submit to the page with the array (states.php) and accept the states entered by the user in the form?
I tried using post, but that didn't work. I was told to use $HTTP_POST_VARS but I have no clue where to use it or why I can't simply use post.
Any suggestions?