Register to
Error A: Please fill in the correct ReCAPTCHA code!
« Go Back");
}
$getusername = $mysqli->real_escape_string($_POST["musername"]); # Get Username
$username = preg_replace("/[^A-Za-z0-9 ]/", '', $getusername); # Escape and Strip
$password = $mysqli->real_escape_string($_POST["mpass"]); # Get Password
$confirm_password = $mysqli->real_escape_string($_POST["mpwcheck"]); # Get Confirm Password
$email = $mysqli->real_escape_string($_POST["memail"]);
$birth = "1990-01-01";
$ip = $_SERVER["REMOTE_ADDR"];
$continue = false;
require_once('assets/config/recaptchalib.php');
$publickey = "6LemqAwAAAAAAF4dIpSjTB3GJt1ax0MRQ9FvOX_T";
$privatekey = "6LemqAwAAAAAAO69RT3j9M1eHPX_ahhmC6Gakuwb";
$resp = null;
$error = null;
if ($_POST["recaptcha_response_field"]) {
$resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if ($resp->is_valid) {
$continue = true;
}
}
if (!$continue) {
echo ("Error: Please fill in the correct ReCAPTCHA code!
« Go Back ");
} else {
$select_user_result = $mysqli->query("SELECT id FROM accounts WHERE name='".$username."' OR email='".$email."' LIMIT 1");
$returned = $select_user_result->num_rows;
if ($returned > 0) {
echo ("Error: This username or email is already used!
« Go Back ");
} else if ($password != $confirm_password) {
echo ("");
} else if (strlen($password) < 4 || strlen($password) > 12) {
echo ("Your password must be between 4-12 characters
« Go Back ");
} else if (strlen($username) < 4 || strlen($username) > 12) {
echo ("Your username must be between 4-12 characters
« Go Back ");
} else if (!strstr($email, '@')) {
echo ("You have filled in a wrong email address
« Go Back ");
} else {
//All data is ok
$insert_user_query = "INSERT INTO accounts (`name`, `password`, `email`) VALUES ('".$username."', '".hash("sha1", $password)."', '".$email."')";
$mysqli->query($insert_user_query);
echo "Success! Please head over to the downloads page to get started!
";
}
}
}
?>