How people in my server can do an account in internet ??
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 33
- Joined: Tue Aug 01, 2006 2:28 am
How people in my server can do an account in internet ??
How the people who playing in my server can make an account in my site ????
-
- Posts: 33
- Joined: Tue Aug 01, 2006 2:28 am
-
- Advanced User
- Posts: 308
- Joined: Wed May 10, 2006 11:40 am
- Location: U.K.
This should get you there. Assuming $con is an already active db connection, $username is the user name, $password is the password they want to use.
Personally, I restrict the characters they can use to create character names, but that's another story. You can leave out the first statement if you want. Thanks to Law for the password encryption code, by the way.
$usrname = strtolower($usrname);
$enc_password = base64_encode(pack("H*", sha1(utf8_encode($password1))));
$todaydate = (time() * 1000);
$sql = "insert into $dblog_l2jdb.accounts (login, password, lastactive, access_level, lastip) values ('$usrname', '$enc_password', '$todaydate', '0', '0')";
$result_i = mysql_query($sql,$con);
if (!$result_i)
{ echo "<h2 class=\"dropmain\">Error - Can't create user account!</h2>"; }
Personally, I restrict the characters they can use to create character names, but that's another story. You can leave out the first statement if you want. Thanks to Law for the password encryption code, by the way.
$usrname = strtolower($usrname);
$enc_password = base64_encode(pack("H*", sha1(utf8_encode($password1))));
$todaydate = (time() * 1000);
$sql = "insert into $dblog_l2jdb.accounts (login, password, lastactive, access_level, lastip) values ('$usrname', '$enc_password', '$todaydate', '0', '0')";
$result_i = mysql_query($sql,$con);
if (!$result_i)
{ echo "<h2 class=\"dropmain\">Error - Can't create user account!</h2>"; }
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
- ThePhoenixBird
- L2j Inner Circle
- Posts: 1857
- Joined: Fri May 27, 2005 5:11 pm