[英]PHP use header location to redirect in the frameset
会话无效后,我使用php中的标头位置重定向到登录页面。
代码很简单。
PHP代码:
if($_SESSION['admin_id']){
header('location:login.php');
}
但是问题发生了,尽管超时了,但我在布局的主框架中刷新了浏览器的login.php负载。
这是框架集代码的布局。 HTML代码:
>>><frameset rows="135,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="index.php?action_type=top" name="topframe" scrolling="no" noresize="noresize" id="topframe" title="" />
<!--<fram src ="index.php?action_type=content" name="maiframe" scrolling="no" noresize="noresize" id="mainframe" />-->
<frameset cols="225,*" frameborder="no" border="0" framespacing="0">
<frame src="index.php?action_type=menu" name="menuframe" scrolling="no" noresize="noresize" id="menuframe" title="" />
<frame class="framebordertop" src="index.php?action_type=login-info" name="mainframe" scrolling="auto" noresize="noresize" id="mainframe" title="" />
</frameset>
</frameset>
<noframes>
</noframes>
<?php
if( ....... ){ //if session is invalid
die("<script>
if(typeof(parent) != 'undefined'){
parent.window.location.href='login.php';
}else{
window.location.href='login.php';
}
</script>");
}
?>
尝试这个 ?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.