fus10n Posted April 4, 2011 Share Posted April 4, 2011 Okay, so im making a basic registration forum but keep getting an error on line 29. Here is the code: <?PHP // register2.php include("dbconnect.php"); $errors = ""; if (!isset($_POST['username'])) $errors .= "Please provide a username. <br/>"; if (!isset($_POST['password'])) $errors .= "Please provide a password. <br/>"; if (!isset($_POST['email'])) $errors .= "Please provide an email address. <br/>"; if (!isset($_POST['first'])) $errors .= "Please provide a First Name. <br/>"; if (!isset($_POST['last'])) $errors .= "Please provide a Last Name. <br/>"; if (!isset($_POST['country'])) $errors .= "Please provide a Country. <br/>"; if (!isset($_POST['state'])) $errors .= "Please provide a State. <br/>"; if (!isset($_POST['street'])) $errors .= "Please provide a Street Address. <br/>"; if (!isset($_POST['city'])) $errors .= "Please provide a City. <br/>"; if (!isset($_POST['zip'])) $errors .= "Please provide a Postal Code. <br/>"; if ($errors == "") { mysql_query("INSERT INTO user_list VALUES( '', '".addslashes($_POST['username'])."', '".md5($_POST['password])."', '".addslashes($_POST['email'])."', '".addslashes($_POST['first'])."', '".addslashes($_POST['last'])."', '".addslashes($_POST['country'])."', '".addslashes($_POST['state'])."', '".addslashes($_POST['street'])."', '".addslashes($_POST['city'])."', '".addslashes($_POST['zip'])."', ") or die(mysql_error()); echo "Registration Successful!"; } else { echo $errors."Please go back and try again."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/232613-registration-forum-help-should-be-easy/ Share on other sites More sharing options...
jcbones Posted April 4, 2011 Share Posted April 4, 2011 '".md5($_POST['password])."', //<-missing closing string quote (') after password. Quote Link to comment https://forums.phpfreaks.com/topic/232613-registration-forum-help-should-be-easy/#findComment-1196431 Share on other sites More sharing options...
Pikachu2000 Posted April 4, 2011 Share Posted April 4, 2011 And why are you using addslashes with mysql? mysql_real_escape_string() would be preferable. Quote Link to comment https://forums.phpfreaks.com/topic/232613-registration-forum-help-should-be-easy/#findComment-1196441 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.