I am entering unknown waters (for me) with the following script and trying to get my head round what it is doing.
I think it goes like this....
I post a form to this script,
STDIN is read in from the form and an additional param 'cmd' is added to it,
The entire new query string is posted to the address in the HTTP::Request line,
Another string '$status' is returned from that call.
The script functions but I am getting an uexpected returned value and am making sure I am looking at the correct section.
I have checked the function HTTP::request in cpan but as always, the terminology is a little confusing.
Keith
I think it goes like this....
I post a form to this script,
STDIN is read in from the form and an additional param 'cmd' is added to it,
The entire new query string is posted to the address in the HTTP::Request line,
Another string '$status' is returned from that call.
Code:
read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
$query .= '&cmd=_notify-validate';
# post back to PayPal system to validate
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$req = new HTTP::Request 'POST','[URL unfurl="true"]http://www.paypal.com/cgi-bin/webscr';[/URL]
$req->content_type('application/x-[URL unfurl="true"]www-form-urlencoded');[/URL]
$req->content($query);
$res = $ua->request($req);
$status = $res->content;
I have checked the function HTTP::request in cpan but as always, the terminology is a little confusing.
Keith