Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Share] registering script for PHP

Initiate Mage
Joined
Sep 9, 2008
Messages
3
Reaction score
0
This is a simple code that uses php to register an account.
currently it does not do anything else but register an account.

what it does:
encode password CORRECTLY (it md5 hashes it WITH kikugalanet)
automatically make a mysql entry for the account
check if the username or the ID code do not already exist
The ID codes are in a logical order now.

I'm planning to making this a nice little add-on to the game, where one can change co
 
Last edited:
Newbie Spellweaver
Joined
Sep 9, 2008
Messages
61
Reaction score
0
I host it in the DB of the web site?
ty

OBS> Sorry for Noobish
 
Skilled Illusionist
Joined
Nov 24, 2007
Messages
329
Reaction score
9
I had already posted a similar code like this a few pages ago, didn't hash it correctly but it looks like it would work...
 
Initiate Mage
Joined
Sep 9, 2008
Messages
3
Reaction score
0
I had already posted a similar code like this a few pages ago, didn't hash it correctly but it looks like it would work...

I know, i tested it and it works..
I do php coding but my codes are a bit sloppy :scratch:
ah well :p
 
Initiate Mage
Joined
Oct 1, 2008
Messages
2
Reaction score
0
0=banned
100=normal
800=gm
It not working when i test if the register and when i put the id and pass to test. Then it say

<?
include 'md5.php';
include 'connect.php';

$level='user'; //change 'admin' to 'gm' for GM registration, or to 'user' to register as normal user.

/*
liek this:
$level='gm';
$level='user';
*/


switch($level)
{
case'admin':
$access='1000';
break;
case'gm':
$access='800';
break;
case'user':
$access='100';
break;
default:
$access='100';
break;
}

$q = mysql_query("SELECT * FROM `accounts`");
while($row = mysql_fetch_array($q)){
$id = $row['id'];
}
$id=$id+1;
$user=$_POST['usr'];
if (mysql_fetch_row(mysql_query("SELECT * FROM accounts WHERE username = '$user'"))) {
die ("the username already exists..");
}
$query = "INSERT INTO accounts (id, username, password, accesslevel, logged_in, channelnum, bankpassword, bankpenya1, bankpenya2, bankpenya3)
VALUES ('$id', '$user', '$pwd', $access, '0', '0', '1337', '999999999', '999999999', '999999999')";
mysql_query($query) OR die('error! '.mysql_error());
mysql_close();
echo"You have been registered!";
?>
 
Back
Top