in reply to Redirecting form data to external site
If you want to POST the data, you will need to generate a form to do it, and with the help of some javascript *ducks* you can make it autosubmit.
sub paypal_redirect { my ($query, $total_cost) = @_; my $cgi = CGI->new; print $cgi->header; # normal header print $cgi->start_form(-method => 'post', -action=>'https://www.paypal.com/cgi-bin +/webscr'); print $cgi->hidden(-name => '_cmd', -value => '_xclick'); print $cgi->hidden(-name => 'business', -value => $email); print $cgi->hidden(-name => 'item_name', -value => $comment); print $cgi->hidden(-name => 'item_number', -value => $query->pa +ram('session')); print $cgi->hidden(-name => 'amount', -value => $total_cost); print $cgi->hidden(-name => 'no_note', -value => 1); print $cgi->hidden(-name => 'currency_code', -value => 'USD'); print $cgi->submit('Continue to PayPal'); # you will need that +button in case # the user has JS off +. print $cgi->end_form; print <<JS; <script language="JavaScript"> <!-- document.forms[0].submit(); //--> </script> JS }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Redirecting form data to external site
by Anonymous Monk on Nov 21, 2003 at 10:09 UTC | |
by cLive ;-) (Prior) on Nov 21, 2003 at 14:57 UTC | |
by Anonymous Monk on Nov 21, 2003 at 20:29 UTC | |
by cLive ;-) (Prior) on Nov 23, 2003 at 01:20 UTC |