Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("../config.php");
- session_start();
- $password = md5($_POST['password']);
- if(!isset($_SESSION["account"]))
- {
- $email = htmlspecialchars($_POST['email']);
- $query = mysql_query("SELECT mail FROM users WHERE mail = '$email' LIMIT 1");
- if(mysql_num_rows($query) > 0)
- header("Location: ./index.php?error=email");
- }
- else
- {
- $account = $_SESSION['account'];
- $query = mysql_query("SELECT * FROM users WHERE mail = '$account' LIMIT 1");
- $user = mysql_fetch_array($query);
- $password = $user['password'];
- $email = $_SESSION['account'];
- }
- $username = $_POST['username'];
- $query = mysql_query("SELECT username FROM users WHERE username = '$account' LIMIT 1");
- if(mysql_num_rows($query) > 0)
- header("Location: ./index.php?error=username");
- if(!preg_match('/^[a-zA-Z0-9._:,-]+$/i', $username))
- header("Location: ./index.php?error=username");
- $query = mysql_query("INSERT INTO users (username, password, mail, look, motto, account_created, last_online, ip_last, ip_reg, auth_ticket,credits) VALUES ('".$_POST['username']."', '".$password."', '".$email."', '".$_POST['figure']."', 'Habboon', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."', '', '5000')");
- mysql_query("UPDATE users SET credits = '5000' WHERE username = '".$username."'");
- $query = mysql_query("SELECT * FROM users WHERE username = '$username' LIMIT 1");
- $user = mysql_fetch_array($query);
- $id = $user['id'];
- $query = mysql_query("INSERT INTO user_stats (id, RoomVisits, OnlineTime, Respect, RespectGiven, GiftsGiven, GiftsReceived, DailyRespectPoints, DailyPetRespectPoints) VALUES ($id, 0, 0, 0, 0, 0, 0, 3, 3)");
- $_SESSION['account'] = $email;
- header("Location: ../characters.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement