Changing perl to PHP
| From: | Richard Kurth | Date: | Wed, 12 Sep 2001 06:01:39 +0000 |
| Subject: | Changing perl to PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-67002@lists.php.net to get a copy of this message | ||
Could somebody tell me how to convert this little bet of code to PHP.
The rest of the code for this was easy to do but I dont know what to
do with this. Can I call LWP from php and if yes how?
# read the post from PayPal system and add 'cmd'
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','https://www.paypal.com/cgi-bin/webscr';
$req->content_type('application/x-www-form-urlencoded');
$req->content($query);
$res = $ua->request($req);
Best regards,
Richard
mailto:rkurth@pacifier.com