PHP登录验证

<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
include 'connet.php';
@$name=$_GET['name'];
@$pass=$_GET['pass'];
if ($name && $pass){
 $sql = "SELECT * FROM user WHERE name = '$name' and pass='$pass'";
 $res = mysql_query($sql);
 @$rows=mysql_num_rows($res);
  if($rows){
  echo "登录完成,3秒后自动跳转首页<script>
setTimeout(function(){location='index.html'},3000)//这里是指停留5秒后跳转到主页
</script>";
  
  exit;
 }
 echo "用户名密码错误,3秒后自动返回<script>
setTimeout(function(){location='log.html'},3000)//这里是指停留5秒后跳转到主页
</script>";
}else {
 echo "用户名密码不能为空,3秒后自动返回<script>
setTimeout(function(){location='log.html'},3000)//这里是指停留5秒后跳转到主页
</script>";
}
?>———————————————————————————————————————————————————————————————— 我在想PHP登录验证 用不用 COokie hu60 的登录是怎么验证的
回复列表(3|隐藏机器人聊天)
添加新回复
回复需要登录