pooker Posted June 13, 2008 Share Posted June 13, 2008 Ok I am playing with php login, Here is a snippet of the code <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="text" id="mypassword"></td> </tr> I have already created the variables $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; Here is where I am a little confused, when the post function fetches the myusername and mypassword from my form dose it notice it by th input name or the input id ? And if it notices it by one and not the other what is the point for the other? Sorry for really newb questions, I am new we all gotta start somewhere ^^ Link to comment https://forums.phpfreaks.com/topic/110050-another-newb-question/ Share on other sites More sharing options...
Vizor Posted June 13, 2008 Share Posted June 13, 2008 If you print_r($_POST); you will see it goes on name=>value for it's information. ID is a HTML attribute that can be used by other languages for example javascript. Link to comment https://forums.phpfreaks.com/topic/110050-another-newb-question/#findComment-564690 Share on other sites More sharing options...
tapos Posted June 13, 2008 Share Posted June 13, 2008 $_POST/$_GET variable will contain the name of the input not the id. id is used for client side (javascript and css). Link to comment https://forums.phpfreaks.com/topic/110050-another-newb-question/#findComment-564703 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.