将HTTP POST信息传递给另一个脚本 - 如何? [英] Passing HTTP POST information to another script - How?

查看:63
本文介绍了将HTTP POST信息传递给另一个脚本 - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我有一种情况,我希望在同一个

表单上有多个提交按钮,因此想要使用重定向php检查与提交表单变量关联的

值的脚本,以计算按下哪个提交是否为
,然后相应地将用户重定向到另一个php页面。


我用过:

header(" location:myphpscript.php")


这样做。


但是,这不会自动传递表格中发送的信息

POST。我确实开始考虑将$ _REQUEST重新编码为GET字符串,以便

附加到URL,但这有点粗糙,因为原始表单提交

使用了一个帖子,有很多信息(其中一些也在

$ _FILES中保存)。


那么还有更好的方法吗?我如何模拟一个帖子?


我关于这个主题的第二个相关问题(我将分别发布这个

但这里可能更好)是否可以通过HTTP GET传递的信息量是否有限制。

我曾经记得读过URL有255个字符的限制地址和

如果这还包括变量后的信息?这是相当的限制。


亲切的问候


戴夫

Hi there,

I have a situation where I want to have multiple submit buttons on the same
form and therefore want to use a redirection php script that checks the
value associated with the submit form variable to calculate which submit was
pressed and then redirects the user to another php page accordingly.

I used:
headers ("location:myphpscript.php")

to do this.

However automatically this does not pass on the information sent in the form
POST. I did start looking into reencoding the $_REQUEST into a GET string to
append to the URL, but this is a bit crude because the original form submit
uses a post and had a lot of information (some of which is also held in
$_FILES).

So is there a better way to go about this? How can I simulate a POST?

My second related question on this subject (I was going to post this
separately but it''s probably better here) is whether there is a limit to the
amount of information that can be passed via an HTTP GET.
I once remember reading there is a 255 character limit to a URL address and
if this also includes the variable information after the ? this is quite
restrictive.

Kind regards

Dave

推荐答案

_REQUEST到GET字符串中

附加到URL,但这有点粗糙,因为原始表单提交

使用一个帖子,有很多信息(其中一些也在
_REQUEST into a GET string to
append to the URL, but this is a bit crude because the original form submit
uses a post and had a lot of information (some of which is also held in


_FILES)。


所以有一个更好的方法来解决这个问题?我如何模拟一个帖子?


我关于这个主题的第二个相关问题(我将分别发布这个

但这里可能更好)是否可以通过HTTP GET传递的信息量是否有限制。

我曾经记得读过URL有255个字符的限制地址和

如果这还包括变量后的信息?这是相当的限制。


亲切的问候


Dave
_FILES).

So is there a better way to go about this? How can I simulate a POST?

My second related question on this subject (I was going to post this
separately but it''s probably better here) is whether there is a limit to the
amount of information that can be passed via an HTTP GET.
I once remember reading there is a 255 character limit to a URL address and
if this also includes the variable information after the ? this is quite
restrictive.

Kind regards

Dave


" Dave Smithz" < SPAM FREE WORLD>写道:
"Dave Smithz" <SPAM FREE WORLD> wrote:
你好,

我有一种情况,我想在
相同的表格上有多个提交按钮,因此想要使用一个重定向php脚本,它检查与提交表单变量相关的值,以计算按下哪个
提交,然后将用户重定向到另一个php页面


>我用过:
标题(location:myphpscript.php)

这样做。

然而,这自动不会传递发送的信息
表单POST。我确实开始考虑重新编码
Hi there,

I have a situation where I want to have multiple submit buttons on the
same form and therefore want to use a redirection php script that checks
the value associated with the submit form variable to calculate which
submit was pressed and then redirects the user to another php page
accordingly.

I used:
headers ("location:myphpscript.php")

to do this.

However automatically this does not pass on the information sent in the
form POST. I did start looking into reencoding the


这篇关于将HTTP POST信息传递给另一个脚本 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆