YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

cURL and process.php Options
joshtrav
#1 Posted : Wednesday, May 12, 2010 7:19:45 AM
Rank: Starting Member

Groups: Registered

Joined: 5/12/2010
Posts: 1
Location: Alaska
I have a front donation page that runs through the process.php file, and I use cURL to auto submit the information.

Currently cURL works fine when I do it like so:
Code:

$params = a3=5.00&p3=1&t3=M&a1='.$amount.'&p1=3&t1=M&no_note=1&no_shipping=1&currency_code=USD&custom="'.$custom.'"&item_name='.$steam.'&business=email@gmail.com&sra=1&src=1&cmd=_xclick-subscriptions';
$url = 'https://www.paypal.com/cgi-bin/webscr';
$user_agent = "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)";
   
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);

echo "result".$result;


However, when I attempt to do so with cmd=_donations, it does not work:
Code:

$params = 'cmd=_donations&business=email@gmail.com&lc=US&item_name='.$steam.'&amount='.$amount.'&currency_code=USD';
$url = 'https://www.paypal.com/cgi-bin/webscr';
$user_agent = "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)";
   
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);

echo "result".$result;


Any help would be greatly appreciated I have been working on this for days now.

Thanks in advance,
Josh
Sponsor  
 
nds_webdesign
#2 Posted : Thursday, May 13, 2010 5:21:09 AM
Rank: Junior Member

Groups: Registered

Joined: 10/15/2009
Posts: 159
Location: Omaha, NE USA
I would say instead of using curl to do the post just do a redirect:

Code:
header("location: https://www.paypal.com/cgi-bin/webscr?$params");


Let me know if that doesn't work I'll try to help you out further.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.129 seconds.