我有一个问题,当用户已经注册我回去与浏览器上的按钮,这个页面不重定向我,我有一个代码,以便当你输入一个注册用户将其发送到特定的网站。 提出了“该页面无法显示” 没有我重定向我,虽然我有一个代码,这转回php代码是错误的
if (isset ($ _ SESSION ['email']))
{
header ("location: sesion.php");
exit();
}
是什么问题
我有一个问题,当用户已经注册我回去与浏览器上的按钮,这个页面不重定向我,我有一个代码,以便当你输入一个注册用户将其发送到特定的网站。 提出了“该页面无法显示” 没有我重定向我,虽然我有一个代码,这转回php代码是错误的
if (isset ($ _ SESSION ['email']))
{
header ("location: sesion.php");
exit();
}
是什么问题
你有2个问题。首先,页面通常由浏览器缓存。这可以通过将页面设置为不cahce(以下方法之一不需要全部完成)来解决。
在PHP在页面顶部:
session_start();
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
在.htaccess:
<filesMatch "\.(html|htm|js|css)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
其次你的代码有额外的空间:
if (isset($_SESSION['email'])) {
header("location: sesion.php");
exit();
}
ohh我的上帝:(当我把代码特别退出(); 页面没有加载,不通过不显示我消息即向下的页面不记录给用户就好像在读取第一个代码时停止 :(:(:(( –
)你试图在session.php中运行这个任务,并且它正在创建一个无限循环? –
你需要有session_start();作为第一行代码。确保没有空间或任何东西 –
我有它 这是我的代码在顶部
i have it
this is my code in the top
[code]<?php
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
session_start();
//================problema
if (isset($_SESSION['email'])) {
header ("location: sesion.php");
exit();
}
//================problema
//pregunta si existe el pass segundo del formulario con esto no puede entrar a la web por el link si no se esta registrando
if(!isset($_POST['rpass'])){
header('Location: ../../index.php');
exit();
}[code]
的手册中,这是我告诉你要做的,它完美的工作?为什么把第二个答案,而不是检查我的? –
是真的有这个空间? '__ SESSION' –
当你在浏览器中点击时,浏览器取回缓存页面而不是新页面 –