HTML & PHP question
In my HTML form, I have this line:
and in my PHP above the HTML, I have this line:
<input type="text" name="email" id="email"/>
In the HTML, please can someone tell me the difference between name="email" and id="email"
$email = mysql_real_escape_string($_POST['email']);
which one is the 'email' in the PHP code taken from? name or id? Do I need both name and id?
It's taken from name="".
Originally Posted by ParfaitMacaron
The ID is used for associating the <label> with the <input> (assuming there is one). The <label> should have for="email" to associate it with this input. Then a user can clearly know that the label and input are directly connected.
I understand! Thank you so much for answering. :)
Originally Posted by ralph.m