2. ByKuznec, <?
include_once("conf.php");
include_once("mysql.php");
if($on==1){
include_once("css/1.php");
echo "Вы уже авторизованы<br/>";
}else{
$aut = $_GET['aut'];
switch($aut){
case '':
include_once("css/1.php");
echo "» <a href='index.php'>На главную</a>";
echo "<form method='post' action='enter.php?aut=aut'>\n";
echo "Логин:<br /><input type='text' name='nick' size='8' maxlength='32' /><br />\n";
echo "Пароль:<br /><input type='password' name='pass' size='10' maxlength='32' /><br/>\n";
echo "<input type='submit' value='Войти' />";
echo "</form>";
break;
case 'aut':
include_once("css/1.php");
include_once("conf.php");
include_once("mysql.php");
if($_POST['nick']!="" && $_POST['pass']!=""){
$nick = $_POST['nick'];
$nick=filtr($nick);
$pass = $_POST['pass'];
$pass=filtr($pass);
$pass_us=md5($pass);
$pf = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `nick` = '$nick' AND `pass` = '$pass_us'"));
if($pf[id]!=""){
SetCookie("nick","$nick",time()+155520);
SetCookie("pass","$pass",time()+155520);
echo"<b>1</b>";
SetCookie("nick","$nick",time()+155520);
SetCookie("pass","$pass",time()+155520);
}else{
include_once("css/1.php");
echo"<b>Внимание!</b><br/>Логин или Пароль введен неверно.<br/><a href='enter.php'>Попробуйте снова</a>";
}
}else{
include_once("css/1.php");
echo"<b>Внимание!</b><br/>Одно из полей не введено.<br/><a href='enter.php'>Попробуйте снова</a>";
}
break;
}
}
include_once("down.php");
?>