Home > Backend Development > PHP Tutorial > php验证session 报错了解决办法

php验证session 报错了解决办法

WBOY
Release: 2016-06-13 10:08:57
Original
980 people have browsed it

php验证session 报错了
session_start();
if(!isset($_SESSION['admin_cking'])){
$_SESSION['admin_cking']=array();
unset($_SESSION['admin_cking']); 
session_destroy(); 
echo "<script>alert('温馨提示:\n\n尊敬的管理员,您好,由于您太长时间未进行相关操作,系统自动默认您放弃操作,如需再操作,请您点击确定之后重新登入。');location.href='admin_loginx.php'</script>";
exit;
}
?>

这段代码运行结果是 空白的

没弹出也不会跳转哦

哪里写错了啊 望指点 谢谢

------解决方案--------------------
echo "<script>alert('温馨提示:\\n\\n尊敬……<br /><br />双\ 转义<br /><font color='#e78608'>------解决方案--------------------<br />不会吧,我都运行了。<br /><font color='#e78608'>------解决方案--------------------<br />多半是你的程序文件有 BOM 头,出错啦<br /><br />打开错误显示功能就可以看到原因了<div class="clear"></script>

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