dotBz Posted March 13, 2008 Share Posted March 13, 2008 hmm. may we see the source.. also do an "echo" of the query.. $sql = "SELECT * FROM table;"; echo $sql; that would help i guess Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491079 Share on other sites More sharing options...
dizzleboi1 Posted March 13, 2008 Author Share Posted March 13, 2008 REGISTER.PHP <?php include_once "functions.php"; connect(); if(!isset($_POST['submit'])){ echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n"; echo "<form method=\"post\" action=\"register.php\">\n"; echo "<tr><td colspan=\"2\" align=\"center\">Registration Form</td></tr>\n"; echo "<tr><td>Username</td><td><input type=\"text\" name=\"username\"></td></tr>\n"; echo "<tr><td>Password</td><td><input type=\"password\" name=\"password\"></td></tr>\n"; echo "<tr><td>Confirm</td><td><input type=\"password\" name=\"passconf\"></td></tr>\n"; echo "<tr><td>E-Mail</td><td><input type=\"text\" name=\"email\"></td></tr>\n"; echo "<tr><td>Name</td><td><input type=\"text\" name=\"name\"></td></tr>\n"; echo "<tr><td>AIM Address</td><td><input type=\"text\" name=\"aim\"></td></tr>\n"; echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Register\"></td></tr>\n"; echo "</form></table>\n"; }else { $username = protect($_POST['username']); $password = protect($_POST['password']); $confirm = protect($_POST['passconf']); $email = protect($_POST['email']); $name = protect($_POST['name']); $aim = protect($_POST['aim']); $errors = array(); if(!$username) { $errors[] = "Username is not defined!"; } if($password){ $errors[] = "Password is not defined!"; } if($password){ if(!$confirm){ $errors[] = "Confirmation password is not defined!"; } } if(!$email){ $errors[] = "Email is not defined!"; } if(!$name){ $errors[] = "Name is not defined!"; } If (!$aim){ $errors[] = "AIM Screename is not defined!"; } if ($username) { if(!ctype_alnum($username)){ $errors[] = "Username can only contain numbers and letters!"; } $range = range(1,31); if(in_array(strlen($username),$range)){ $errors[] = "Username must be between 1 and 32 charecters!"; } } if($password && $confirm){ if ($password != $confirm){ $errors[] = "Passwords do not match!"; } } if($email){ $checkemail = "/^[a-z0-9+([_\\.-][a-z0-9]+([\.-\[a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i"; if(!preg_match($checkemail, $email)){ $errors[] = "Email is not valied, must be name@server.tld"; } } if($name){ $range2 = range(1,64); if(!in_array(strlen($name),$range2)){ $errors[] = "Your name must be between 3 to and characters!"; } } if($aim){ $range3 = range(3,16); if(!in_array(strlen($aim),$range3)){ $errors[] = "Your AIM screename must be between 3 and 16 charecters!"; } } if($username){ $sql = "SELECT * FROM `users` WHERE `username`='{$username}'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) > 0) $errors[] = "The username you supplied is already in use!"; } } if($email){ $sql2 = "SLECT * FROM `users` WHERE `email`='{$email}'"; $res2 = mysql_query($sql2) or die(mysql_error()); if(mysql_num_rows($res2) > 0){ $errors[] = "The email you supplied is already in use of another user!"; } } if($aim){ $sql3 = "SELECT * FROM `users` WHERE `aim`='{$aim}'"; $res3 = mysql_query($sql3) or die(mysql_error()); if(mysql_num_rows($res3) > 0){ $errors[] = "The AIM screename you supplied is already in use of another user!"; } } if(count($errors) > 0){ foreach($errors AS $error){ echo $error . "<br>\n"; } }else { $sql4 = "INSERT INTO `users` (`username`,`password`,`email`,`name`,`aim`) ('$username','".md5($password)."','$email','$name','$aim');"; $res4 = mysql_query($sql4) or die(mysql_error()); echo "You have successfully registered with the username <b>{$Username}</b> and the password of <b>{$password}!</b>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491209 Share on other sites More sharing options...
dizzleboi1 Posted March 13, 2008 Author Share Posted March 13, 2008 comeon ? Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491216 Share on other sites More sharing options...
MadTechie Posted March 13, 2008 Share Posted March 13, 2008 $sql4 = "INSERT INTO `users` (`username`,`password`,`email`,`name`,`aim`) ('$username','".md5($password)."','$email','$name','$aim');" should be $sql4 = "INSERT INTO `users` (`username`,`password`,`email`,`name`,`aim`) VALUES ('$username','".md5($password)."','$email','$name','$aim');" Note the word VALUES Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491219 Share on other sites More sharing options...
dizzleboi1 Posted March 13, 2008 Author Share Posted March 13, 2008 Parse error: syntax error, unexpected T_VARIABLE in /home/MYNAME/public_html/register.php on line 132 Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491233 Share on other sites More sharing options...
MadTechie Posted March 13, 2008 Share Posted March 13, 2008 missing the end ; $sql4 = "INSERT INTO `users` (`username`,`password`,`email`,`name`,`aim`) VALUES ('$username','".md5($password)."','$email','$name','$aim');"; Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491236 Share on other sites More sharing options...
soycharliente Posted March 13, 2008 Share Posted March 13, 2008 You mean you need to move the incorrectly placed ; outside of the quotes? Not add another one? Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491245 Share on other sites More sharing options...
dizzleboi1 Posted March 13, 2008 Author Share Posted March 13, 2008 another error in the t string my php designer highlighted this echo "You have successfully registered with the username <b>{$Username}</b> and the password of <b>{$password}!</b>"; Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491249 Share on other sites More sharing options...
soycharliente Posted March 13, 2008 Share Posted March 13, 2008 That looks right to me. Maybe it's spilling over from the line before that. Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491257 Share on other sites More sharing options...
dizzleboi1 Posted March 13, 2008 Author Share Posted March 13, 2008 PROBLEM RESOLVED I GOT IT WORKING Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491259 Share on other sites More sharing options...
dizzleboi1 Posted March 13, 2008 Author Share Posted March 13, 2008 thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491261 Share on other sites More sharing options...
MadTechie Posted March 13, 2008 Share Posted March 13, 2008 well php says you shouldn't but mysql says you should.. unless your using mysqli, but it works eitherway thats line looks fine.. except it should be $username not $Username Quote Link to comment https://forums.phpfreaks.com/topic/95889-solved-php-register-to-blank-page/page/2/#findComment-491265 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.