battles/register.php

25 lines
645 B
PHP

<?php
require_once "config.php";
if (
!empty($_POST['login']) &&
!empty($_POST['psw']) &&
!empty($_POST['email']) &&
!empty($_POST['birthday']) &&
!empty($_POST['law']) &&
!empty($_POST['law2']) &&
!empty($_COOKIE[GAMEDOMAIN])
) {
$_SESSION['uid'] = Register::addUser($_POST['login'], $_POST['psw'], $_POST['email'], $_POST['birthday']);
if ($_SESSION['uid'] !== 0) {
$_SESSION['sid'] = session_id();
setcookie(GAMEDOMAIN, $_SESSION['uid'], time() + 3600);
setcookie("battle", time());
header('Location: fight.php');
exit;
}
}
require_once 'views\register.php';