i found this form in none working position and i edited it to make all errors go away and i also updated it so it would work for wotlk....
this form is better then respora for people who create there own sites because it is easier to integrate it into the site.
Code:
<?php
$realmd = array(
'db_host'=> 'localhost', //ip of db realm
'db_username' => 'user',//realm user
'db_password' => '',//realm password
'db_name'=> 'realmd',//realm db name
);
function check_for_symbols($string){
$len=strlen($string);
$alowed_chars="abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ";
for($i=0;$i<$len;$i++)if(!strstr($alowed_chars,$string[$i]))return TRUE;
return FALSE;
}
function sha_password($user,$pass){
$user = strtoupper($user);
$pass = strtoupper($pass);
return SHA1($user.':'.$pass);
}
if (isset($_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){
echo "Could NOT connect to db, please check the config part of the file!";
die;
}
$username = $_POST['username'];
$password = sha_password($username,$_POST['password']);
$qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
if (check_for_symbols($_POST['password']) == TRUE || check_for_symbols($username) == TRUE || mysql_num_rows($qry_check_username) != 0){
echo "Error with creating account, might already be in use or your username / password has invalid symbols in it.";
}else{
mysql_query("INSERT INTO account (username,sha_pass_hash,expansion) VALUES
('$username','$password','2')");// Insert into database.
echo "Account created.";
}
}else{
?>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
Username <input type="text" name="username">
Password <input type="password" name="password">
<input type="submit" name="registration">
</form>
<?php
// Do not remove this;)
}
?>
to use it just edit
'db_host'=> 'localhost', //ip of db realm
'db_username' => 'user',//realm user
'db_password' => '',//realm password
'db_name'=> 'realmd',//realm db name
and insert into your website.