首页 > 代码库 > php

php

if ($name && $passowrd){
$sql = "SELECT * FROM liuyanban WHERE name = ‘$name‘ and password=‘$passowrd‘";
$res = mysql_query($sql);
$rows=mysql_num_rows($res);
if($rows){
header("refresh:0;url=a.htm");//跳转页面,注意路径
exit;
}
echo "<script language=javascript>alert(‘用户名密码错误‘);history.back();</script>";
}else {
echo "<script language=javascript>alert(‘用户名密码不能为空‘);history.back();</script>";
}

php