[kw-pm] Redirection in Perl CGI

Raymond broadswd at gmail.com
Mon Jul 27 16:28:34 PDT 2009


If you're just asking to have the POST go to a different script, just
change the "action" in the form. Which is what Max is talking about.

I thought you were asking how to redirect a POST, which you can't
guarantee browser behaviour for. That's why I suggested acting as the
user and handling/proxying the response with the second location.

Basically the HTTP standard says a user agent may only follow a
redirect without user interaction if the method is GET or HEAD, some
browsers will follow the 3xx (rediect) after a pop-up about the POST
but others won't.

Which are you asking about?

2009/7/27 Max <max at alleged.net>:
> Normally you would use POST and provide the parameters as the data of the
> POST (properly encoded), and decode them on the other end, rather than using
> GET and URL parameters.
>
> Raymond wrote:
>>
>> You can always open another connection (using LWP for example) and
>> post the sanitised variables to that script and do whatever you want
>> with the response (eg. display to the user).
>>
>> A lot of payment gateways are used in this manner.
>>
>> On 7/27/09, Robert Pike <roberthpike at yahoo.com> wrote:
>>
>>>
>>> CGI application: what's the best way to take content passed in to a perl
>>> script from a form and have that content passed on/redirected to another
>>> script? Anyone know how to accomplish this without having to tack onto
>>> the
>>> url? Thanks.
>>>
>>>
>>>      __________________________________________________________________
>>> Looking for the perfect gift? Give the gift of Flickr!
>>>
>>> http://www.flickr.com/gift/
>>>
>>> _______________________________________________
>>> kw-pm mailing list
>>> kw-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/kw-pm
>>>
>>>
>>
>>
>
>


More information about the kw-pm mailing list