php登陆判断..没办法判断数据库里面的用户名和密码。。
$name=$_POST["user"];$passwd=md5($_POST["pwd"]);include("conn.php");if($name==null){e...
$name=$_POST["user"];
$passwd=md5($_POST["pwd"]);
include("conn.php");
if($name==null){
echo "<script>alert('用户名不能为空');window.location.href='index.html';</script>";
}
if($passwd==null){
echo "<script language='javascript' type='text/javascript' >alert('密码不能为空');window.location.href='index.html';</script>";
}
//查询sql语句
$sqlst="SELECT * FROM `skiyo_admin` WHERE `skiyo_name` = '".$name."'AND `skiyo_passwd` = '".$passwd."';";
//判断用户名和密码是否错误。
$result=mysql_query($sqlst );
if(mysql_fetch_array($result)){
echo "<script> alert('登录成功!点击确定跳转页面');window.location.href='mian.html';</script>";
}
else
{
echo "<script > alert('登陆失败,用户名或密码输入错误');window.location.href='index.html';</script>";
} 展开
$passwd=md5($_POST["pwd"]);
include("conn.php");
if($name==null){
echo "<script>alert('用户名不能为空');window.location.href='index.html';</script>";
}
if($passwd==null){
echo "<script language='javascript' type='text/javascript' >alert('密码不能为空');window.location.href='index.html';</script>";
}
//查询sql语句
$sqlst="SELECT * FROM `skiyo_admin` WHERE `skiyo_name` = '".$name."'AND `skiyo_passwd` = '".$passwd."';";
//判断用户名和密码是否错误。
$result=mysql_query($sqlst );
if(mysql_fetch_array($result)){
echo "<script> alert('登录成功!点击确定跳转页面');window.location.href='mian.html';</script>";
}
else
{
echo "<script > alert('登陆失败,用户名或密码输入错误');window.location.href='index.html';</script>";
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询