Hello,
I have a question about PHP. I realized that you can use the POST variable to get data from a form submitted with the type post, but does the order of the fields matter. Example:
index.html:
<HTML>
<HEAD>
<TITLE>Form</TITLE>
</HEAD>
<BODY>
<FORM name='test' action='submit.php' method='post'>
Name: <INPUT type='text' name='name' /><br />
Programming Language <INPUT type='text' name='lang' /><br />
<INPUT type='submit' value='submit' />
</FORM>
</BODY>
</HTML>
Here's the code for submit.php:
<?php
//This code works
echo $_POST['name'];
echo "<br />"
echo $_POST['lang'];
//But if I flip the two, it doesn't.
echo $_POST['lang'];
echo "<br />"
echo $_POST['name'];
?>
My question is: Why does flipping the two POST vars make this code not work? If there is a way (besides of course writing it as the values are ordered, which will be hard since I am not sure what order the form's elements will be in) to get by this? Thanks Everyone for your great help!!!