if(isset($_GET['c'])){ include __DIR__.'/dbcon.php'; $cookie = clean($_GET['c']); $user = dbQuery("SELECT * FROM users where cookie=".$cookie)[0]; if($user){ $time = time(); $timeNG = $time - 3600 *2; $timeNGbodrost = $time - 8640 *2; if($user['start']<1) dbQuery("UPDATE `users` SET `bodrost` = $timeNGbodrost, `sitost` = $timeNG, `vnimanie` = $timeNG, `intellect` = $timeNG, `start` = $time WHERE `users`.`cookie` = ".$cookie); setcookie("login", $_GET['c'], time()+3600*24*400); } header("Location: /"); exit(); } if($_SERVER['REQUEST_URI'] != '/'){ header("Location: /"); exit(); } $health = 0; $bodrost = 0; $sitost = 0; $vnimanie = 0; $intellect = 0; $sleep = 0; $born = 1; $livedDays = 0; $heal = 1; $words = '[]'; $uId = 0; $young = 1; if(isset($_COOKIE['login'])){ include __DIR__.'/dbcon.php'; $startParams = getStartParams(); if($startParams){ $health = $startParams['health']; $bodrost = $startParams['bodrost']; $sitost = $startParams['sitost']; $vnimanie = $startParams['vnimanie']; $intellect = $startParams['intellect']; $sleep = $startParams['sleep']; $born = $startParams['born']; $livedDays = $startParams['livedDays']; $heal = $startParams['heal']; $words = $startParams['words']; $uId = $startParams['user']; $young = $startParams['young']; } else { $_COOKIE['login'] = ""; } } ?>