Файл: game.php
Строк: 22
<?php
session_start();
include ('private/mysql.php');
include ('tmp/head.php');
if($uid){
header('Location: index.php');
exit;
}
$ser = mysql_fetch_assoc(mysql_query("SELECT * FROM `server`"));
if($ser['reg']=='off'){
header('Location: index.php');
exit;
}
$stro = rand(0,1);
if($stro == 0){$storona = "white";}
if($stro == 1){$storona = "dark";}
$pass = rand(100000,999999);
$hash = md5(md5($pass));
$q = mysql_query("SELECT * FROM `users` WHERE `test`!='' ORDER BY `id` DESC LIMIT 1");
$w = mysql_fetch_assoc($q);
$login = $w['test']+1;
$log = "Странник_$login";
mysql_query("INSERT INTO `users` SET `test`='$login',`login`='$log',`password`='$hash',`pol`='man',`storona`='$storona',`np`='ok'");
header("Location: autorize.php?login=$log&password=$pass");
exit;
?>