- Joined
- Feb 7, 2011
- Messages
- 3
- Reaction score
- 0
I am trying to create a login script that would work on MMORPG game to log in with the game accounts on website.
Maybe its just for me , but it is quite hard to actually find working login script.
This is the register script code
And i dont understand what kind of passwords it logs in database.
Its md5 [hash] uses javascript file [ MD5.js ]
Maybe its just for me , but it is quite hard to actually find working login script.
This is the register script code
And i dont understand what kind of passwords it logs in database.
Its md5 [hash] uses javascript file [ MD5.js ]
PHP:
<?php
if($_GET['act'] == "register")
{
if(PhpCaptcha::Validate($_POST['CheckCode']))
{
mysql_select_db($mydbacc);
$userid = trim($_POST['id']);
$password=trim($_POST['pass']);
$passretype=trim($_POST['retpass']);
$hash=$_POST['hash'];
if(!ereg("^[0-9a-z]{4,12}$",$userid))
{
echo "Only letters from \"a\" to \"z\" and numbers, lenght of 4 to 12 characters";
}
else
{
if($password == $passretype)
{
if(!ereg("^[0-9a-zA-Z]{4,12}$",$password))
{
echo "Only letters or numbers, lenght of 4 to 12 characters";
}
else
{
$res = mysql_query("select * from account where name = '".$userid."' order by id desc");
if(mysql_num_rows($res) == 0)
{
mysql_query("insert into account (name,Password,Reg_date) values ('".$userid."','".$hash."','".date("y-m-d H:i:s", time())."')");
echo "Account registered successfully.";
}
else
{
echo "Account Already exists in database.";
}
}
}
else
{
echo "Password not equal to Retyped Password.";
}
}
}
else
{
echo "Check Code is Wrong";
}
}
?>

