生成SESSION loginok.php
点击返回'); } if(isset($_POST['submit']) == ""){ exit('非法访问!!'); } $username= htmlspecialchars(trim($_POST['username']));$pwd = MD5(trim($_POST['pwd']));include('conn.php');$mql="select userid from users where username ='$username' and pwd='$pwd' limit 1"; $check_user =mysql_query($mql,$conn); if($result =mysql_fetch_array($check_user)){ $_SESSION['username']= $username; $_SESSION['userid'] = $result['$userid']; echo $username.',欢迎到来!用户中心[code=php
'; echo '点击进入主页'; exit();}else{ echo '登陆失败!点击返回'; } ?>
重发一下,乱了
生成SESSION loginok.php
点击返回'); }if(isset($_POST['submit']) == ""){ exit('非法访问!!'); }$username= htmlspecialchars(trim($_POST['username']));$pwd = MD5(trim($_POST['pwd']));include('conn.php');$mql="select userid from users where username ='$username' and pwd='$pwd' limit 1"; $check_user =mysql_query($mql,$conn); if($result =mysql_fetch_array($check_user)){ $_SESSION['username']= $username; $_SESSION['userid'] = $result['$userid']; echo $username.',欢迎到来!用户中心
'; echo '点击进入主页'; exit();}else{ echo '登陆失败!点击返回'; }?>
登陆 注册";}else{ $username =$_SESSION['username']; echo $username.",欢迎到来注销"; echo $_SESSION['userid']; echo "登陆 注册";}
什么浏览器测试的,多个浏览器测试看看。
ie和搜狗都不行
firefox 和chrome 可以不
解决了,很简单24行 $_SESSION['userid'] = $result['$userid'];错了,还是百度知道好
已抢67227个
抢已抢40825个
抢已抢2899个
抢已抢4627个
抢已抢19666个
抢