我有HTML表单,我必须提交相同的页面上的形式,其中的那种形式,添加POST变量,然后所有的变量传递到下一个页面。我尝试这样做:PHP着POST变量
<form method="POST" action="">
<input type="TEXT" name="names" />
<input type="TEXT" name="email" />
<input type="submit" name="send" />
</form>
,然后这个PHP代码:
if($_POST['send']){
$_POST['digest'] = "someText here";
header("HTTP/1.0 307 Temporary redirect");
header("Location:https://nextpage.com/form");
}
但是当我重定向到另一个网页,所有的POST数据,不同的是 “$ _ POST [ '消化']” 发..我该怎么办 ?
感谢,并为英语不好对不起。
你不得不添加'digest'到URL(这当然会变成一个GET变量,有长度的限制等),我不认为有一种方法做你想要的东西。 (其实我很惊讶,浏览器重新发布POST数据到新的URL。这是记录/预期?) – 2013-04-08 18:49:30
看http://stackoverflow.com/questions/653090/how-do-you-post-to- a-page-using-php-header-function – Heberfa 2013-04-08 18:51:48
@Pekka웃:它可能因浏览器而异。看到这个帖子:http://stackoverflow.com/questions/46582/response-redirect-with-post-instead-of-get – Alekc 2013-04-08 18:52:00