Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql_connect($host_db, $user_db, $password_db) or die(mysql_error());
- mysql_select_db($database_db) or die(mysql_error());
- if ($_POST['user'] == "") {
- die('You must provide a username. Click<a href = "register.php"> here </a>to go back and try again.');
- }
- if ($_POST['pass'] == "") {
- die('You must provide a password, <a href = "register.php"> go Back </a>.');
- }
- if ($_POST['pass'] != $_POST['passRetype']) {
- die('Your passwords do not match, <a href = "register.php"> go Back </a>.');
- }
- $user=$_POST["user"];
- $pass=$_POST["pass"];
- $passRetype=$_POST["passRetype"];
- if ('$user' > 12) {
- die('Your username must be within 12 characters, <a href = "register.php"> go Back </a>.');
- }
- $existing_account = mysql_query("SELECT * FROM characters WHERE username = '$user' LIMIT 1");
- if (mysql_num_rows($existing_account) == 1) {
- die('This username has already been taken. Click<a href = "register.php"> here </a>to go back and try again.');
- }
- $account_count = mysql_query("SELECT * FROM characters") or die(mysql_error());
- $newID = 1;
- while ($row = mysql_fetch_array($account_count)) {
- $newID++;
- }
- mysql_query("INSERT INTO characters VALUES('$newID', '$user', '$pass', '3252', '3421', '0', '10', '100', '-1', '0', '0', '100', '1', '1', '0', '1', '1', '0', '127.0.0.1', '0', '0', '0', '0', '0', '0', '0', '0', '0')") or die(mysql_error());
- echo ('Your account has been created. You may now login with it.');
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement