Hello, I’m having an issue with my registration code. for some reason, everything functions properly up until it gets to the actual data insertion portion of the php. It bumps me over to my error code “$errormsg = “An error has occurred. Your account was not created.”;”
Can somebody tell me why this is? I’ve looked it over for a few hours now.
[code=php]
if ($_POST[‘submitbtn’]){
$getuser = $_POST[‘user’];
$getemail = $_POST[’email’];
$getpass = $_POST[‘pass’];
$getverifypass = $_POST[‘verifypass’];
$lastloginip = $_SERVER[‘REMOTE_ADDR’];
$getfirstname = $_POST[‘firstname’];
$getlastname = $_POST[‘lastname’];
$getbirthmonth = $_POST[‘birthmonth’];
$getbirthday = $_POST[‘birthday’];
$getbirthyear = $_POST[‘birthyear’];
$getgender = $_POST[‘gender’];
if ( $getuser){
if ( $getemail){
if ( $getpass){
if ( $getverifypass){
if ( $getpass === $getverifypass){
if ( ( strlen($getemail) >= 7 ) && ( strstr($getemail, ‘@’) ) && ( strstr($getemail, ‘.’) ) ){
require(‘connect.php’);
$query = mysql_query(“SELECT * FROM members415 WHERE username=’$getuser'”);
$numrows = mysql_num_rows($query);
if ($numrows == 0){
$query = mysql_query(“SELECT * FROM members415 WHERE email=’$getemail'”);
$numrows = mysql_num_rows($query);
if ($numrows == 0){
$password = md5(md5(“salt”.$getpass.”salt”));
$date = date(‘M d, Y’);
$code = md5(rand());
mysql_query(“INSERT INTO tc_members415 (‘id’, ‘username’, ‘password’, ’email’, ‘last_logindate’, ‘join_date’, ’emailactivated’, ‘code’, ‘firstname’, ‘lastname’, ‘last_loginip’, ‘birthdate_month’, ‘birthdate_day’, ‘birthdate_year’, ‘gender’, ‘admin_user’, ‘admin_entity’, ‘admin_art’, ‘admin_galaxy’, ‘admin_global’, ‘subscription’, ‘character’, ‘pm_setting’) VALUES (”, ‘$getuser’, ‘$password’, ‘$getemail’, ‘$date’, ‘$date’, ‘0’, ‘$code’, ‘$getfirstname’, ‘$getlastname’, ‘$lastloginip’, ‘$getbirthmonth’, ‘$getbirthday’, ‘$getbirthyear’, ‘$getgender’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ’30’, ‘None’, ‘0’)”);
$query1 = mysql_query(“SELECT * FROM members415 WHERE username=’$getuser'”);
$numrows = mysql_num_rows($query1);
if ($numrows == 1){
$site = ‘http://www.edit.com’;
$headers = ‘From: TC Admin <[email protected]>’;
$subject = ‘edit: Activate your account’;
$message = ‘Thanks for registering your edit account. In order to use your account, you must first activate it with the following details; URL: (http://www.edit.com/activate.php) Code: (‘.$code.’) Click the following link to activate your account. ‘.$site.’/activate.php?user=’.$getuser.’&code=’.$code.”;
if (mail($getemail, $subject, $message, $headers)){
$errormsg = “<font color=’blue’>You have been registered. You must activate your account with the activation link sent to <b>$getemail</b></font>”;
echo “$backcontent $errormsg $content.”;
$getuser = ”;
$getemail = ”;
$_POST[‘submitbtn’] = ”;
mysql_close();
}
else
$errormsg = “An error has occurred. Your activation email was not sent.”;
echo “$backcontent <font color’red’>$errormsg</font> $content”;
mysql_close();
}
else
$errormsg = “An error has occurred. Your account was not created.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
mysql_close();
}
else
$errormsg = “There is already a user with that email address.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
mysql_close();
}
else
$errormsg = “There is already a user with that username.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
mysql_close();
}
else
$errormsg = “You must enter a valid email address to register.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
}
else
$errormsg = “Your passwords did not match.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
}
else
$errormsg = “You must verify your password to register.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
}
else
$errormsg = “You must enter a password to register.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
}
else
$errormsg = “You must enter your email to register.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
}
else
$errormsg = “You must enter your username to register.”;
echo “$backcontent <font color=’red’>$errormsg</font> $content”;
}
else