madlady37 Posted November 8, 2016 Share Posted November 8, 2016 (edited) Hello All, Im new with php. I am making a simple login form, and want to echo the variables. here is my code: Help! <body><form id="myForm" method="post"> <table width="400" border="5" align="center"> <tr> <td colspan="5"><h1>Registration Form</h1></td> <tr> <tr> <td>User Name:</td> <td><input type="text" name="name"/></td> <tr> <tr> <td>User Password:</td> <td><input type="password" name="password"/></td> <tr> <tr> <td>Email:</td> <td><input type="text" name="email"/></td> <tr> <tr> <td colspan="5" align="center"><input type="submit" name="submit" value="Sign Up"/><input type="button" onClick="myFunction()" value="Reset" class="masterTooltip" title="Click Here to Start Over."><br /></td> </table></form><script> function myFunction() { document.getElementById("myForm").reset(); }</script></body></html><?phpif ($_SERVER['REQUEST_METHOD']=='POST') { echo $user = $_POST['username']; echo $password = $_POST['password']; echo $email = $_POST['email']; }?> This is the error message I get. Notice: Undefined index: username in C:\xampp\htdocs\The Centorium\registration.php on line 60 Edited November 8, 2016 by madlady37 Quote Link to comment Share on other sites More sharing options...
Barand Posted November 8, 2016 Share Posted November 8, 2016 (edited) Create you own topic. Don't just tack your question on the end of someone else's. EDIT: You have $_POST['username'] but the form field has name='name' Edited November 8, 2016 by Barand Quote Link to comment Share on other sites More sharing options...
madlady37 Posted November 8, 2016 Author Share Posted November 8, 2016 (edited) thank you...I did not know that I could not post under someone else's help, because it would of been a duplicate post, I though. My apologies, and thank you. And of course it worked. Edited November 8, 2016 by madlady37 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.