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¤cy_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.'¤cy_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