Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Redirecting form data to external site

by cLive ;-) (Prior)
on Nov 21, 2003 at 06:40 UTC ( [id://308815]=note: print w/replies, xml ) Need Help??


in reply to Redirecting form data to external site

That won't work. The redirect header is just that - a redirect with no content.

Assuming that the PayPal form accepts QS info, you could get it to work like this:

# build attr hash - expand below... my %attr = ( _cmd => '_xclick', business => $email, item_name => $comment); # create query string name/value pairs my @qsvars=(); for (keys %attr) { # escape values $attr{$_} = $cgi->escape( $attr{$_} ) ; # add to qs vars push @qsvars, "$_=$attr{$_}"; } # create query string my $qs = join '&', @qsvars; # send redirect print $cgi->redirect("https://www.paypal.com/cgi-bin/webscr?$qs"); exit(0);
Or something like that. I've broken down the steps above to make it easier to read, but you could also combine the qs creation into one statement using join and map if you wish.

.02

cLive ;-)

Replies are listed 'Best First'.
Re: Re: Redirecting form data to external site
by fuzzyping (Chaplain) on Nov 21, 2003 at 06:42 UTC
    OMG, I can't believe how stupid I am that I didn't think to just append the URI parameters. LOL! Thanks Clive, I'm sure that should work.

    Update: Actually, it's still experiencing the same 302 errors. I forgot to emphasize that this is a post method, so I'm not sure this will work after all.

    -fp

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://308815]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (8)
As of 2024-10-10 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (45 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.