derrick1123 Posted March 14, 2008 Share Posted March 14, 2008 I am getting the error: Parse error: syntax error, unexpected $end in C:\xampp\htdocs\my_site\m\l-r\register.php on line 130 This is my register.php page... <?php // Register.php $step = $_POST['step']; if($step==0 || $step==""){ echo "<body><html>"; echo "<form method='POST' action='login.php'>"; echo "<input type='hidden' value='1' name='step'>"; echo "Username: <input type='text' name='username' size=30><br>"; echo "Password: <input type='password' name='password' size=30><br>"; echo "Email: <input type='text' name='email' size=30><br>"; echo "<input type='submit' value='register'>"; echo "</form>"; echo "</body></html>"; } if($step==1){ // Functions function gen_key($len){ if($len == 0){ $len = 1; } $letters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); for($x=0; $x!=$len; $x++){ $key .= $letters[rand(0,sizeof($letters))]; } return strtoupper($key); } // Get the POST vars $username = $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; // Connect to the database require("../settings.php"); // Error Check Time! $e = 0; $es = "There were some errors:"; if(strlen($username)<5 || strlen($username)>30){ $e++; $es .= "<br>Username is either too long or too short. Must be between 5 and 30 letters long."; } $r = mysql_query("SELECT * FROM member_system WHERE username='$username'"); if(mysql_numrows($r)>0){ $e++; $es .= "<br>A Member with this username already exists!"; } if(strlen($password)<5 || strlen($password)>30){ $e++; $es .= "<br>Password is either too long or too short. Must be between 5 and 30 letters long."; } if(strlen($email)<8 || !strpos($email, ".") || !strpos($email, "@")){ $e++; $es .= "<br>The email entered appears to be invalid. Please enter a VALID email address."; } $r = mysql_query("SELECT * FROM member_system WHERE email='$email'"); if(mysql_numrows($r)>0){ $e++; $es .= "<br>A Member with this email address already exists!"; } // Go for it! if($e==0){ $key = gen_key(30); $r = mysql_query("INSERT INTO member_system VALUES('','$username','$password','$email','$key');"); echo "Done!<br><br>User '<tt>$username</tt>' successfully registered!<br>You can now <a href='login.htm'>Login!</a>."; } else { echo $es."<br><br><a href='javascript:history.go(-1);'>Back</a>"; } // Close MySQL Connection mysql_close(); ?> <!-- this is line 130 --> If you need any other pages, please say so. I really want to get this fixed. Quote Link to comment https://forums.phpfreaks.com/topic/96108-parse-error-syntax-error-unexpected-end-in-lol/ Share on other sites More sharing options...
derrick1123 Posted March 14, 2008 Author Share Posted March 14, 2008 plz help? Quote Link to comment https://forums.phpfreaks.com/topic/96108-parse-error-syntax-error-unexpected-end-in-lol/#findComment-492006 Share on other sites More sharing options...
sasa Posted March 14, 2008 Share Posted March 14, 2008 you miss one } Quote Link to comment https://forums.phpfreaks.com/topic/96108-parse-error-syntax-error-unexpected-end-in-lol/#findComment-492023 Share on other sites More sharing options...
derrick1123 Posted March 14, 2008 Author Share Posted March 14, 2008 AHH thats right >.< Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/96108-parse-error-syntax-error-unexpected-end-in-lol/#findComment-492027 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.