Very nice but I got the following errors when I tried to use the register.
I edited the config.php correctly and ran it on my XAMPP server.
Maybe someone else can confirm so I know it's not just me.
Also going to add the script I use.
(Even more) Minimalistic
Found and copied from another forum. Forgot who made it. I take no credit. Added & fix a few things.
You can change all the '3' to your specific minimal username length. (Be careful if you use Find and Replace.)
You can change all the '5' to your specific minimal password length. (Be careful if you use Find and Replace.)
<?php
$host = "localhost"; //Your servers IP address
$port = "3306"; //Your servers port
$user = "root"; //Your database username
$pass = "pass"; //Your database password
$auth = "auth"; //Your auth database
$realmlist = "login.server.com"; //This will show up and remind the user the change their realmlist.wtf upon completion.
$realmd = array(
'db_host'=> $host,
'db_username' => $user,
'db_password' => $pass,
'db_name'=> $auth,
);
function check_for_symbols($string){
$len=strlen($string);
$allowed_chars="abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ0123456789";
for($i=0;$i<$len;$i++)if(!strstr($allowed_chars,$string[$i]))return TRUE;
return FALSE;
}
function sha_password($username,$password){
$username = strtoupper($username);
$password = strtoupper($password);
return SHA1($username.':'.$password);
}
if ($_POST['registration']){
$realmd_bc_new_connect = mysql_connect($realmd['db_host'],$realmd['db_username'],$realmd['db_password']);
$selectdb = mysql_select_db($realmd['db_name'],$realmd_bc_new_connect);
if (!$realmd_bc_new_connect || !$selectdb){ die("<p align='center'>Error:<br><br>Something went wrong while connecting to the database.<br><br>Please make sure the config.php file is correct.</p>"); }
$username = $_POST['username'];
$password = $_POST['password'];
$confirm = $_POST['confirm'];
$username1 = $username;
$password1 = sha_password($username1,$_POST['password']);
$email1 = $_POST['email'];
$email = $email1;
if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ die("<p align='center'>Error:<br><br>Your e-mail is not valid!<br><br>It has to be in *@*.* format to be valid.<br><br>Please go back and try again.</p>"); }
if($password != $confirm){ die("<p align='center'>Error:<br><br>It appears your passwords didn’t match!<br><br>Please go back and try again.</p>"); }
//You can change all the '3' to your specific minimal username length.
if(strlen($_POST['username']) < 3){
$chars = strlen($username);
die("<p align='center'>Error:<br><br>Your username is too short!<br><br>You entered ".$chars." character(s).<br><br>The minimum length is 3 characters and the maximum length is 15.<br><br>Please go back and try again.</p>");
}
//You can change all the '5' to your specific minimal password length.
if(strlen($_POST['password']) < 5){
$chars = strlen($password);
die("<p align='center'>Error:<br><br>Your password is too short!<br><br>You entered ".$chars." character(s).<br><br>The minimum length is 5 characters and the maximum length is 15.<br><br>Please go back and try again.</p>");
}
if (check_for_symbols($_POST['password']) == TRUE || check_for_symbols($username1) == TRUE) { die("<p align='center'><br><br>You are using characters not allowed in your username or password!<br><br>Please go back and try again.</p>"); }
$qry_check_username = mysql_query("SELECT username FROM account WHERE username='$username'");
$qry_check_email = mysql_query("SELECT email FROM account WHERE email='$email'");
if (mysql_num_rows($qry_check_username) != 0){ die("<p align='center'>Error:<br><br>Your username is already in use!<br><br>Please go back and try again.</p>"); }
if (mysql_num_rows($qry_check_email) != 0){ die("<p align='center'>Error:<br><br>Your e-mail is already in use!<br><br>Please go back and try again.</p>"); }
else{
mysql_query("INSERT INTO account (username,sha_pass_hash,email,expansion) VALUES ('$username1','$password1','$email1','3')");
die("<p align='center'>Your account <b>".$username1."</b> has been successfully added to the database!<br><br>Make sure you change your realmlist.wtf file to:<br><br><b>set realmlist ".$realmlist."</b><br><br>Please contact one of the staff members if you're having difficulties loggin in after 5-10 minutes.</p>");
}
}
else{
?>
<html>
<head>
<title>WoW - Account Creator</title>
</head>
<body>
<center><h1><u><b>Account Creator</b></u></h1><br>
INSERT TERMS OF AGREEMENT AND RULES HERE
<form autocomplete="off" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
Username:<br><input type="text" name="username"><br><small>(3 or more characters)</small><br><br>
Password:<br><input type="password" name="password"><br><small>(5 or more characters)</small><br><br>
Confirm Password:<br><input type="password" name="confirm"><br><br>
E-mail Address:<br><input type="text" name="email"><br><br>
<input value="By clicking this you accept the Terms of Agreement and to abide by all rules stated above." class="submit" type="submit" name="registration">
</form></center>
</body>
</html>
<?php
}
?>