发布重定向? [英] Post with redirect?

查看:73
本文介绍了发布重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我不确定是否可以这样做,因为我搜索了网页和这个

论坛。 />

我正在使用在线商家提供商,我必须通过我网站上的表格将某些

变量发布到他们的网页表格。


问题是我需要衡量一个用户是否在他们的篮子中有任何物品来决定我们重定向哪个页面。我可以

显然使用cookies或隐藏的字段等但这些可以是

操纵。


如何强制POST但是实际上重定向用户就像

浏览器一样?我可以按照这个

站点(该站点显示为关闭,因此该链接使用Web Archive)执行第一部分(强制发布帖子):
http://web.archive.org/web/200406282...imocsumissions


如果我是第二位我不确定它是否可以完成。


如果不是,我需要询问商家是否允许GET代替。


A

解决方案

UKuser写道:
< blockquote class =post_quotes>



我不确定是否可以这样做,因为我搜索了网页这个

论坛。


我正在使用在线商家提供商,我必须将某些

变量发布到他们的webfo rms通过我网站上的表格。


问题是我需要判断一个用户是否有任何物品在他们的篮子中,以决定哪一页我重定向他们。我可以

显然使用cookies或隐藏的字段等但这些可以是

操纵。


如何强制POST但是实际上重定向用户就像

浏览器一样?我可以按照这个

站点(该站点显示为关闭,因此该链接使用Web Archive)执行第一部分(强制发布帖子):
http://web.archive.org/web/200406282...imocsumissions


如果我是第二位我不确定它是否可以完成。


如果不是,我需要询问商家是否允许GET代替。


A



不容易,不能用PHP完成。浏览器需要处理重定向
,因此您需要从浏览器端执行此操作。这意味着一个

客户端语言,比如javascript。


cURL理论上可以帮助你 - 但是你要求很多/>
工作,特别是如果在

重定向后有多个页面被处理。你必须解析每一页,看看下一步该做什么。


-

============ ======

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


在12月14日,12时48分,杰里Stuckle< jstuck ... @ attglobal.netwrote:

UKuser写道:




我不确定这是否可以我已经在网上搜索了这个

论坛。


我正在使用在线商家提供商,我必须通过我网站上的表格将某些

变量发布到他们的网络表单中。


问题是我需要判断一个用户是否有任何物品在他们的篮子中,以决定哪个页面我重定向他们。我可以

显然使用cookies或隐藏的字段等,但这些可以是

操纵。


如何强制POST但实际上重定向用户就像

浏览器一样?我可以按照这个

站点(该站点显示为关闭,因此该链接使用Web Archive)执行第一部分(强制发布帖子):
http://web.archive.org/web/200406282。 ..nd.com / zend / sp ...


如果我不确定它是否可以,它是第二位或者不可能。


如果不是,我将需要询问商家是否允许GET。


非常感谢


A


不容易,用PHP无法完成。浏览器需要处理重定向
,因此您需要从浏览器端执行此操作。这意味着一个

客户端语言,比如javascript。


cURL理论上可以帮助你 - 但是你要求很多/>
工作,特别是如果在

重定向后有多个页面被处理。你必须解析每一页,看看下一步该做什么。


-

============ ======

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司

jstuck ... @ attglobal.net

==================



感谢您的帮助。应该已经意识到,因为它的服务器端它是b / b
使它变得不可能。关于如何使用AJAX / JS的任何想法?


UKuser写道:


你好,


我不确定是否可以这样做,因为我搜索了网页和这个

论坛。


我正在使用在线商家提供商,我必须通过我网站上的表格将某些

变量发布到他们的网页表格。


问题是我需要判断一个用户是否在他们的篮子中有任何物品来决定我们重定向哪个页面。我可以

显然使用cookies或隐藏的字段等但这些可以是

操纵。


如何强制POST但是实际上重定向用户就像

浏览器一样?我可以按照这个

站点(该站点显示为关闭,因此该链接使用Web Archive)执行第一部分(强制发布帖子):
http://web.archive.org/web/200406282...imocsumissions


如果我是第二位我不确定它是否可以完成。


如果不是,我需要询问商家是否允许GET代替。



您可以使用fsockopen向另一方发出POST请求或者curl

你将得到一个你可以评估的回复。


但这不是重定向,因为重定向将由

浏览器如果您发送位置标题。


Joe


Hi,

I''m not sure if this can be done as I''ve searched the web and this
forum.

I am using an online merchant provider and I must post certain
variables to their webforms through a form on my website.

The issue is that I need to gauge whether a user has any items in
their basket to decide which page I redirect them too. I could
obviously use cookies or hidden fields etc but these can be
manipulated.

How can I force a POST but actually redirect the user as well like a
browser would do? I can do the first part (force the post) as per this
site (the site appears down, so the link uses the Web Archive):
http://web.archive.org/web/200406282...imocsumissions

Its the second bit if I''m not sure whether it can or can''t be done.

If not I''ll need to ask the merchant if they allow GET instead.

Many thanks

A

解决方案

UKuser wrote:

Hi,

I''m not sure if this can be done as I''ve searched the web and this
forum.

I am using an online merchant provider and I must post certain
variables to their webforms through a form on my website.

The issue is that I need to gauge whether a user has any items in
their basket to decide which page I redirect them too. I could
obviously use cookies or hidden fields etc but these can be
manipulated.

How can I force a POST but actually redirect the user as well like a
browser would do? I can do the first part (force the post) as per this
site (the site appears down, so the link uses the Web Archive):
http://web.archive.org/web/200406282...imocsumissions

Its the second bit if I''m not sure whether it can or can''t be done.

If not I''ll need to ask the merchant if they allow GET instead.

Many thanks

A

Not easy, and it can''t be done with PHP. The browser needs to process
the redirect, so you need to do it from the browser end. That means a
client-side language such as javascript.

cURL could theoretically help you here - but you''re asking for a lot of
work, especially if there are several pages being handled after the
redirect. You''d have to parse each page to see what to do next.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


On 14 Dec, 12:48, Jerry Stuckle <jstuck...@attglobal.netwrote:

UKuser wrote:

Hi,

I''m not sure if this can be done as I''ve searched the web and this
forum.

I am using an online merchant provider and I must post certain
variables to their webforms through a form on my website.

The issue is that I need to gauge whether a user has any items in
their basket to decide which page I redirect them too. I could
obviously use cookies or hidden fields etc but these can be
manipulated.

How can I force a POST but actually redirect the user as well like a
browser would do? I can do the first part (force the post) as per this
site (the site appears down, so the link uses the Web Archive):
http://web.archive.org/web/200406282...nd.com/zend/sp...

Its the second bit if I''m not sure whether it can or can''t be done.

If not I''ll need to ask the merchant if they allow GET instead.

Many thanks

A


Not easy, and it can''t be done with PHP. The browser needs to process
the redirect, so you need to do it from the browser end. That means a
client-side language such as javascript.

cURL could theoretically help you here - but you''re asking for a lot of
work, especially if there are several pages being handled after the
redirect. You''d have to parse each page to see what to do next.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Thanks for your help. Should have realised because its server side it
makes it impossible. Any thoughts on how it could be done with AJAX/JS?


UKuser wrote:

Hi,

I''m not sure if this can be done as I''ve searched the web and this
forum.

I am using an online merchant provider and I must post certain
variables to their webforms through a form on my website.

The issue is that I need to gauge whether a user has any items in
their basket to decide which page I redirect them too. I could
obviously use cookies or hidden fields etc but these can be
manipulated.

How can I force a POST but actually redirect the user as well like a
browser would do? I can do the first part (force the post) as per this
site (the site appears down, so the link uses the Web Archive):
http://web.archive.org/web/200406282...imocsumissions

Its the second bit if I''m not sure whether it can or can''t be done.

If not I''ll need to ask the merchant if they allow GET instead.

Many thanks

You can make a POST request to an other side with "fsockopen" or "curl"
and you will get a response you can evaluate.

But this is not a redirect because a redirect will be done by the
browser if you send a Location header.

Joe


这篇关于发布重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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