<?
if(isset($_GET['ok']) && 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;
}
}
?>
<center>
<div class="event">
<div></div>
</div>
<div class="content">
<div class="block">
<div class="feedback">
<form action="?auth&ok" method="post"><ul>
<li>
<label>Ник:<br>
<input type="text" value="" name="nick">
</label>
</li>
<li class="pt">
<label>Пароль: (<a href='?pass'>Забыли пароль?</a>)<br>
<input type="password" value="" name="password">
</label>
</li>
<li class="pt">
<input type="submit" value="Войти">
</li>
</ul>
</form>
<div class="pt">
<ul>
<li>
</li>
</ul>
</div>
</div>

</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>";
echo '© Удивительный колхоз 2013 | Все права защищены.';
echo "<div class='feedback'>";
echo'<a href="http://waplog.net/c.shtml?542251"><img src="http://c.waplog.net/542251.cnt" alt="waplog" /></a>';
echo'<a href="http://statok.net/go/583"><img src="http://statok.net/image/583" alt=""/></a>';
exit;
?>