Home > Backend Development > PHP Tutorial > 同样的登录代码,ff中没有有关问题,ie就是不行。

同样的登录代码,ff中没有有关问题,ie就是不行。

WBOY
Release: 2016-06-13 13:12:14
Original
813 people have browsed it

同样的登录代码,ff中没有问题,ie就是不行。。
登录页面 : login.php
共有三个页面,想要打开其它两个页面,若未登录,都会先跳转到登录页面。
输入用户名眼密码正确后,保存到session中,这时可以自由浏览各个页面,不需要重复登录。

ff中没有问题,实现的跟预期一样,
ie中一直显示登录页面,session没有保存成功。希望phper能帮忙解答。谢谢

附完整的 login.php 的代码,如下:

 


if($_GET[out]){
unset($_SESSION['admin_user']);
unset($_SESSION['admin_pass']);

  echo "";
  }
if(!isset($_SESSION['admin_user'])) //**** if ****
{

if(!$_POST['submit']){
echo "please login first!";
include 'login.htm';
}
else{
$admin_user=$_POST['admin_user'];
//echo $admin_user;
$admin_pass=$_POST['admin_pass'];
$rs=$db->execute("select admin_user,admin_pass from ".TABLE_PREFIX."gbconfig where admin_user='".$admin_user."'");
if($db->num_rows($rs)>=1){
$row=$db->fetch_array($rs);
$db->free_result($rs);
//echo "free_result run
".$admin_pass."
";
if($row['admin_pass']==$admin_pass){
$_SESSION['admin_user']=$admin_user;
$_SESSION['admin_pass']=$admin_pass;// save session
//echo "session save successful";

echo "login successful , please wait....
if the browser do not return to the home page ,please click here";
if(isset($_SESSION['userurl'])){
$url=$_SESSION['userurl'];
//header("location:$url");

//location.href=$_SESSION['userurl'];
echo "";
}
else
echo "";
// echo "";

}
else{
echo "";
}
}
else{
echo "";
echo "";


}



}
}
else{ // **** else **** 

?>

退出


echo "show list";
?>


}?>

管理登录页面



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template