use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => 'http://www.paypal.com/cgi-bin/webscr');
my $res = $ua->request($req);
if ($res->is_success) {
$Log="c:\\sambar50\\cgi-bin\\unicorn\\paypal.html";
open (LOG,">>$Log");
print LOG $res->as_string;
close LOG;
} else {
print "Failed: ", $res->status_line,
"\n";
I'm stumped....
Paul Bickwermert wrote:
Hi Frank,The only problem with that is "it will show all the variables in the browser line. Then they can simply look up there and see where they will be redirected from paypal after the payment. Then they will just go to the return url, and not pay me first.
With the java script, the variables are passed as hidden. This is what I need to do with perl.
I need a perl script that will open them a new window, and send the variables to paypal with the post method. (that is the way they have it setup.)
Then in the old window, I need it to reload my original page.
I have gotten it work with the java script, but I have not found a way to do this without the java part.
To see a example of this, go to http://ww3.xtra-money.com/test.html
It works, but if someone has the _javascript_ turned off on their browser, I am afraid it will not work then and I will lose a client.
If you need, I will send you a copy of the perl script I have so far. Let me know.
Thanks everyone.
Paul Bickwermert
On 01/Apr/2003 12:11:39, Frank Cools wrote:
> Hi Paul,
>
> I assume by cgi you mean Perl-script where you can access any URL directly.
> The only thingy is that in Perl (someone please correct if I'm wrong) you
> can only use the "GET"-method.
> This means you have to format the URL as follows:
>
> "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&bussiness=herbs@herb-
> 4-life.com&....."
>
> Also watch out for special characters, like the '@', you have to replace
> that with %64.
> All spaces you have to replace with %20.
>
> I think this should work, I've used it once to use multiple search-engines
> with only typing the search-string once.
>
> Cheers,
>
> Frank.
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
> Of Paul Bickwermert
> Sent: mardi 1 avril 2003 10:36
> To: sambar List Member
> Subject: [sambar] Who can convert java to cgi? {01}
>
>
> Hello Everyone,
>
> I need to convert a peice of java to a cgi so I do not have to rely on
> _javascript_ being enabled in people's browser.
>
> Here is a sample of the java script I am using in a cgi file.
>
>
> ----------------------------------------------------------
> <form name="autoform" method="POST"
> action=""https://www.paypal.com/cgi-bin/webscr">https://www.paypal.com/cgi-bin/webscr" target=new>
> <input type="hidden" name="cmd" value="_xclick">
> <input type="hidden" name="business" value="herbs@herb-4-life.com">
> <input type="hidden" name="undefined_quantity" value="1">
> <input type="hidden" name="item_name" value="Product 1">
> <input type="hidden" name="amount" value="1.00">
> <input type="hidden" name="shipping" value="0.00">
> <input type="hidden" name="no_shipping" value="1">
> <input type="hidden" name="return" value="http://ww3.xtra-money.com">
> <input type="hidden" name="cancel_return"
> value="http://www.herb-4-life.com">
> </form>
>
>
> <script language="_javascript_">
> <!--
> {
> document.autoform.submit();
> }
> // -->
> </script>
>
> --------------------------------------------------------
>
> This auto submits my form data to paypal from a cgi with a meta refresh tag
> loading a temp.html file with this code in it.
>
> I want to be able to do this without the java in my cgi file.
>
> Any Ideas?
>
> Thanks for the help...
>
> Paul Bickwermert
> -------------------------------------------------------
> To unsubscribe please go to http://www.sambar.ch/list/
> -------------------------------------------------------
> To unsubscribe please go to http://www.sambar.ch/list/
>
>
>
-------------------------------------------------------
To unsubscribe please go to http://www.sambar.ch/list/
