if (isset($acc_logged) && isset($pass_logged) && $acc_logged != "" && $pass_logged != "") {
if ($acc_logged == "111111" || $acc_logged == "1") {
echo "<h1>Error!</h1><p>Due to safetey reasons this account number is blocked!</p><br />";
$error = 1;
}
if (strlen($acc_logged) < 6 || strlen($acc_logged) > 8 || strlen($pass_logged) < 3 || strlen($rlname) > 17 || strlen($location) > 25 || strlen($mail) > 40) {
echo "<h1>Error!</h1><p>Please fill out the form correctly!</p>";
$error = 1;
} else if (!is_numeric($acc_logged)) {
echo "<h1>Error!</h1><p>Your account number must consist of 6 to 8 digits!</p>";
$error = 1;
} else {
$temp = strspn("$pass_logged", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890 ");
if ($temp != strlen($pass_logged)) {
echo "<h1>Error!</h1><p>Your password must consist of more then 2 letters or numbers (ABC, abc, 123 and blankspaces)!</p>";
$error = 1;
} else {
if ($rlname == '') {
echo "<h1>Error!</h1><p>Please fill your real life name due to safety reasons.</p>";
$error = 1;
} else {
if ($location == '') {
echo "<h1>Error!</h1><p>Please fill in your location due to safety reasons.</p>";
$error = 1;
} else {
if ($mail == '') {
echo "<h1>Error!</h1><p>Please fill your email adress due to safety reasons.</p>";
$error = 1;
} else {
if ($error == 0) {
$query = mysqli_query('SELECT * FROM accounts WHERE (accno = '.$acc_logged.')');
if (mysqli_num_rows($query) != 0) {
echo("<h1>Error!</h1><p>This account number already exist. Please go <a href=\"account.php?page=register\">back</a> and refill the form.</p>");
include ('footer.inc.php');
die;
}
//$sql = "INSERT INTO accounts(id, accno, password, type, premDays, email, blocked, rlname, location, hide, hidemail) values(NULL,'$acc_logged','$pass_logged','1','0','$mail','0', '$rlname', '$location', '$show', '$hidemail')";
$sql = "INSERT INTO accounts(id, accno, password, type, premDays, premEnd, email, blocked, rlname, location, hide, hidemail) values(NULL,'$acc_logged','$pass_logged','1','0','0','$mail','0', '$rlname', '$location', '$show', '$hidemail')";
mysqli_query($sql);
session_unset();
?>
<h1>Congratulations!</h1><p>Your account were successfully created. Please login to create your first character.<br /></p>
<?
}
}
}
}
}
}
}