<?php
include './system/bd.php';
include './system/cook.php';
include ("./system/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include './system/head.php';

if(empty($_POST[login])){
$login=$_GET[login];
}else{
$login=$_POST[login];}
$login = htmlspecialchars(stripslashes($login));


switch($_GET[go]) {
default:
echo "
<div class='title'> Поиск по нику</div>
<div class='empty_block del_bottom item_center'> 
<form action=\"search.php?go=go\" method=\"post\">Ник персонажа:<br/>";
echo "<input name=\"login\" maxlength=\"16\" title=\"login\" emptyok=\"true\"/><br/>";
echo "<input type=\"submit\"class=\"button\" value=\"искать\" /></form></div>";

break;
case 'go':
$req = mysql_query("SELECT id FROM `user` WHERE `login` = '$login'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=="0"){
echo' <div class="empty_block del_bottom item_center"> 
Нет такого персонажа!
</div>';
include './system/foot.php';
exit;
}
$usdata = mysql_fetch_array($req);
if($login==$user[login]){  header ("Location: user.php?"); 
}else{
 header ("Location: users.php?id=$usdata[id]");
}

}
}else{
header ("Location: index.php"); exit;
}
include './system/foot.php';
?>
