Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require('../includes/config.php');
- require('../structure/database.php');
- require('../structure/base.php');
- require('../structure/user.php');
- require('../structure/user.register.php');
- $database = new database($db_host, $db_name, $db_user, $db_password);
- $base = new base($database);
- $user = new user($database);
- $register = new user_register($database);
- //preform basic checks before loading page
- if($user->isLoggedIn()) $base->redirect('../index.php');
- if(!isset($_SESSION['age']) || !isset($_SESSION['country']) || !isset($_SESSION['username']) || !isset($_SESSION['terms']) || !isset($_SESSION['salt']) || !isset($_SESSION['password'])) $base->redirect('index.php');
- $cookie = $register->generateCookie();
- //create new account
- $database->processQuery("INSERT INTO `users` VALUES (null, ?, ?, ?, ?, 'nope.avi', ?, 1, ?, '', '', ?, 0, 0, 1, 0, 0, 0)", array($_SESSION['username'], $_SESSION['password'], $_SESSION['age'], $_SESSION['country'], date('M-d-Y'), $_SERVER['REMOTE_ADDR'], $cookie), false);
- $username = $_SESSION['username'];
- $register->clear();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement