Файл: warhis.ru/start.php
Строк: 15
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if($user) {
header('location: /');
exit;
}
$ref = _string(_num($_GET['ref']));
$password = rand(1,999999);
if(mysql_query('INSERT INTO `users` (`login`,
`password`) VALUEs ("Боец",
"'.$password.'")')) {
$id = mysql_insert_id();
if($ref) {
$ref_user = mysql_query('SELECT * FROM `users` WHERE `id` = "'.$ref.'"');
$ref_user = mysql_fetch_array($ref_user);
if($ref_user) {
mysql_query('INSERT INTO `ref` (`user`,
`ho`) VALUEs ("'.$ref_user['id'].'",
"'.$id.'")');
}
}
$user = mysql_query('SELECT * FROM `users` WHERE `id` = "'.$id.'"');
$user = mysql_fetch_array($user);
$_g = 100000000;
$_s = 100000000;
mysql_query('UPDATE `users` SET `hp` = "'.($user['vit'] * 2).'",
`mp` = "'.$user['mana'].'" WHERE `id` = "'.$id.'"');
mysql_query('UPDATE `users` SET `g` ="'.$_g.'",
`s` ="'.$_s.'" WHERE `id` = "'.$id.'"');
setCookie('id', $user['id'], time() + 86400, '/');
setCookie('password', $password, time() + 86400, '/');
header('location: /');
}
?>