Home >Backend Development >PHP Tutorial > 登陆页面,该怎么处理
登陆页面
include 'coon.php';
@$username=$_POST[username];
@$password=$_POST[password];
$md5_pass=md5($password);
if(@$_GET[out]){
setcookie("cookie", "out");
echo "";
}
$query="select username,password from user where username='$username'
and password='$md5_pass'";
$result=mysql_query($query);
$num_rows=mysql_num_rows($result);
$row=mysql_fetch_array($result);
if($num_rows>0)
{
$passsword1=$row['password'];
if($passsword1==$password)
{
setcookie("cookie","ok");
echo "";
}
}
else {
echo "";
}
if(@$_COOKIE['cookie']!='ok'){
?>