$conn=mysql_connect('localhost','root','root');mysql_select_db('testdb',$conn);mysql_query('set name utf8',$conn);if (!empty($_REQUEST['n'])||!empty($_REQUEST['p'])){ $username=$_REQUEST['n']; $password=$_REQUEST['p']; $sql="select * from admin where username='$username'and password='$password',$conn"; $re=mysql_query($sql,$conn); $arr=mysql_fetch_array($re); if ($arr) { echo "<script type=text/javascript>alert('登录成功');window.location.href='login-1.php';</script>"; } else { echo "<script type=text/javascript>alert('用户名或密码错误');/*window.location.href='login-second.html';*/</script>"; }}并且Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean givenin F:\lx\lx\login-1.php on line 19
1 回答
- 1 回答
- 0 关注
- 2904 浏览
添加回答
举报
0/150
提交
取消