desjardins2010 Posted December 9, 2010 Share Posted December 9, 2010 alright, I have been trying to create this register.php file all day and it was working fine with one small error I fixed that and now it fails to even show the form jusst getting parse error on line 173 my script ends at 172??? <?php //check for submit $submit =$_POST['submit']; //gather POST variable $fullname =strip_tags($_POST['fullname']); $email =strip_tags($_POST['email']); $username =strip_tags($_POST['username']); $password =strip_tags($_POST['password']); $password2 =strip_tags($_POST['password2']); if ($submit) { //check that fields were filled in if ($fullname&&$email&&$username&&$password&&$password2) { //now we can encrypt our password to md5 $password = md5($password); $password2 = md5($password2); //were done seeting md5 //check to see if our two password fields match if ($password==$password2) { // register the user echo "Success"; } //otherwise if passwords don't match else { echo "<font color='red'>The passwords you entered do not match</font>"; //end of checking password } } else { echo "<font color='red'>Please enter all fields!</font>"; } //end check for submit ?> <form action='test.php' method="post"> <table align="center"> <tr> <td> Your Full Name: </td> <td> <input type="text" name="fullname"> </td> </tr> <tr> <td> Email Address: </td> <td> <input type="text" name="email"> </td> <tr> <td> Choose Username: </td> <td> <input type="text" name="username"> </td> </tr> <tr> <td> Password: </td> <td> <input type="password" name="password"> </td> </tr> <tr> <td> Retype Password: </td> <td> <input type="password" name="password2"> </td> </tr> </table> <p> <center><input type="submit" name="submit" value="Register"></center> </form> Link to comment https://forums.phpfreaks.com/topic/221149-parse-error-really/ Share on other sites More sharing options...
Pikachu2000 Posted December 9, 2010 Share Posted December 9, 2010 Most likely missing a closing curly brace somewhere. Link to comment https://forums.phpfreaks.com/topic/221149-parse-error-really/#findComment-1145076 Share on other sites More sharing options...
desjardins2010 Posted December 9, 2010 Author Share Posted December 9, 2010 I thought the same (and could be) but I checked and double checked... can someone look to see if my if statements are written right when opening a new if statment inside another one? Link to comment https://forums.phpfreaks.com/topic/221149-parse-error-really/#findComment-1145077 Share on other sites More sharing options...
BrendanmPHP Posted December 9, 2010 Share Posted December 9, 2010 Your missing the curly brace to close the if ($submit){ Just before you close the php put a } Link to comment https://forums.phpfreaks.com/topic/221149-parse-error-really/#findComment-1145079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.