num_rows;
if($rowcount == 0)
{
$password = hash('whirlpool', $password);
$password = strtoupper($password);
$ip_address = returnIpAddress();
$user_check_query = "INSERT INTO accounts (Username, Password, Email, IP) VALUES ('$username', '$password', '$email', '$ip_address')";
$result = mysqli_query($link, $user_check_query);
$playersqlid = mysqli_insert_id($link);
$body = "Welcome to Verdant Roleplay, $username!
This is your main account which is generally used to manage your characters. You can't use your main account to play, therefore you will have to create a character. Once this character gets approved by the Tester team you can start to (role)play on our gameserver and manage it on the UCP.
The UCP (User Control Panel) allows you to change your spawn location, your skin and much more. We wish you good luck!
If you have any questions, use the forums or our support site.
Regards,
Verdant Roleplay";
insertNotification($link, $playersqlid, "Welcome!", $body, "Administration");
$chars = array(
array("N/A", -1, 0),
array("N/A", -1, 0),
array("N/A", -1, 0),
array("N/A", -1, 0),
array("N/A", -1, 0)
);
$_SESSION['username'] = $username;
$_SESSION['adminlevel'] = 0;
$_SESSION['playersqlid'] = $playersqlid;
$_SESSION['characters'] = $chars;
$_SESSION['playeremail'] = $email;
$_SESSION['namechanges'] = 0;
$_SESSION['phonechanges'] = 0;
$_SESSION['discord_auth'] = "";
$_SESSION['forum_auth'] = "";
header('location: ./panel/characters');
}
else $gabim = "Username already taken.";
}
else $gabim = "Password does not match.";
}
//else $gabim = "There are a few errors with the form, correct them.";
}
// Close connection
//mysqli_close($link);
?>