小白菜鸟刚刚开始学PHP,555老是做不粗来,心塞塞啊。。木有钱,跪求好心人帮忙
这个登录界面总是会有bug,但是不知道要怎么改进,求帮忙啦!!
<?php
/*
登录界面
*/
error_reporting(E_ALL ^E_NOTICE);
if($_GET['out'])
{
setcookie("cookie","out");
echo "<script>location='login.php';</script>";
}
if($_POST['user']=='admin' && $_POST['pw']=='123')
{
/*setcookie("cookie","ok");
echo "<script language=\"javascript\"> location.href='login.php';</script>";*/
setcookie("cookie","ok");
echo "<script>location='login.php';</script>";
}
if($_COOKIE['cookie']!='ok')
{
echo "<script>alert('用户名或密码不正确');</script>";
}
else
{
echo "<script>alert('登陆成功');</script>";
echo "<a href='login.php?out=out'>退出</a>";
}
?>
用户名:密码: