header("Location: empManage.php")页面跳转到空白页,求解loginProcess.php :php
$res=mysql_query($sql,$conn);if($row = mysql_fetch_assoc($res)){//查询到//取出数据库密码if(($row["password"]== md5($password))){//说明合法header("Location: empManage.php");}}header("Location: login.php?errno=1");exit();mysql_free_result($res);mysql_close($conn);/*//简单验证(不到数据库) if($id=="100"&&$password=="123"){//合法,跳转到empManage.php header("Location:empManage.php");//如果要跳转,则最好exit() exit();}else{//非法用户header("Location:login.php?errno=1");exit();}*/?>代码如上,不连接数据库的话可以正常跳转到empManage.php连接数据库后出现空白页,跳转到的页面是loginProcess.php本身,怎么回事啊,在线等解答!!
------解决方案--------------------header()前不能有输出;
必须置于页面HEAD的前面;
根据楼主的问题,检查:
数据库能否正常连接;
编码是否一致;
$row["password"] 和 md5($password) 是否有相等的值------解决方案--------------------我没看出代码有什么错误,建议你先调试看看。把header()改成echo(); 看看有没有输出什么。另外,看一下你是否有打开错误提示------解决方案--------------------$res=mysql_query($sql,$conn);这句没有判错可能导致 if($row = mysql_fetch_assoc($res)){ 有错,由于错误显示未打开,所以是空白页------解决方案--------------------探讨$res=mysql_query($sql,$conn);这句没有判错可能导致 if($row = mysql_fetch_assoc($res)){ 有错,由于错误显示未打开,所以是空白页
