我知道这是一个非常常见的问题,但我找不到答案
我是一个post.php,它将一个帖子表单提交给controller.php
当它正确时,在控制器中它做:
header("Location: ./post?ok=1");
邮件实际插入,它通过上面的行,
但浏览器中的网址似乎永远不会改变,最后没有ok参数,
我可以使用会话变量来存储这样的成功/失败参数,但这种方式应该有效
post.php中:
Controller.php这样:
header("Location: ./post?ok=1");
?>
编辑1:
header("Refresh:1;url=http://localhost/test/post?ok=1"); //doesn't work better
编辑2:
在post.php上面我放了
debug("post l ".count($_POST));
debug("get l ".count($_GET));
它们在提交前显示0,在0之后显示0
edit3:它有效
被阻止:
if ($success){
header("Location: ./post?ok=1");
}
header("Location: ./post");
应该是:
if ($success){
header("Location: ./post?ok=1");
} else {
header("Location: ./post");
}
thx all