Ejemplo n.º 1
0
$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();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<link rel="shortcut icon" href="../img/favicon.ico" />
<title><?php 
echo $data['wb_title'];
?>
</title>
<link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all">