<?
if(isset($_POST['nick']) && isset($_POST['password']))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `nick` = '".my_esc($_POST['nick'])."' AND `password` = '".md5($_POST['password'])."' LIMIT 1"),0)==0)err_game("Неверный ник или пароль");
else
{
$_SESSION['id_user']=mysql_result(mysql_query("SELECT `id` FROM `kolhoz_user` WHERE `nick` = '".my_esc($_POST['nick'])."' AND `password` = '".md5($_POST['password'])."' LIMIT 1"),0);
header("Location:/?myfarm");
exit;
}
}
?>
<div class="event">
<div><h1>Авторизация</h1></div>
</div>
<div class="content">
<div class="block">
<form method="post"><ul>
<li>
<label>Ник:<br>
<input type="text" value="" name="nick">
</label>
</li>
<li class="pt">
<label>Пароль:<br>
<input type="password" value="" name="password">
</label>
</li>
<li class="pt">
<input type="submit" value="Войти">
</form>
</div>
<div class='block'><img width="16" height="16" src="images/icons/reg.png" alt="*">
<a href="?regi">Регистрация</a></div>
<div class='block'><img width="16" height="16" src="images/icons/rename.png" alt="*">
<a href="?pass">Забыли пароль?</a></div>
</ul>
</div>
</div>
<div class="block event">
<img width="16" height="16" src="images/icons/back.png" alt="o"> <a href='index.php'>Главная</a>
</div>
</div>
<?

echo "<div style='text-align:center;' class='pt small minor'>Добавь в закладки";
echo " <a href='http://$_SERVER[HTTP_HOST]' class='epic'><span>$_SERVER[HTTP_HOST]</span></a><br>";

exit;
?>