我有一个包含一些 html 代码的 php 页面。这是注册到该站点的用户的确认页面,因此,我只想在有效注册的情况下显示它(无法从外部访问它)。为此,我将这个条件放在了 Confirmation.php 的开头
if (empty($_POST))
{header('location: registration.php');}
该文件的其余部分是:
<div id="logo"> <img src=my_logo_small_grey.png height="60"/> </div>
<div id="msgConfirm">Thank You</div>
(顺便说一句,这是一个很好的解决方案?)
但是从registration.php开始,如何启动/重定向到confirmation.php发送POST参数?其实我用过AJAX:
url = "confirmation.php";
params = "ok"
ajaxReq.setRequestHeader("Content-length", params.length);
ajaxReq.open("POST", url, true);
但似乎只执行脚本(思想),没有有效的重定向..为什么?