Jump to content

cURL() Error - Please Help


Northern Flame

Recommended Posts

Im working on a script that will have the user enter some information,

the information will then be stored in my database, the user will then

be taken to a paypal page where he will buy a product, once he buys

it he will be redirected back to my site and be emailed a password to

enter the members area. I know how to do all this but I my cURL() function

that sends him to the paypal page to pay doesnt seem to be working.

Heres the script:

 

<?php
			function Post($vars,$url){
		        $ch = curl_init();
		        curl_setopt($ch,CURLOPT_URL,$url);
		        curl_setopt($ch,CURLOPT_POST,1);
		        #curl_setopt($ch,CURLOPT_UPLOAD,1);
		        curl_setopt($ch,CURLOPT_POSTFIELDS,$vars);
		        curl_exec($ch);
		        curl_close($ch);
			}
			$url = 'https://www.paypal.com/cgi-bin/webscr';
			$submit = "https://www.paypal.com/en_US/i/btn/btn_buynow_SM.gif";
			$ret = "http://www.mywebsite.com/sample/?page=confirmed";
			$vars = "cmd=_xclick&[email protected]&item_name=Red_Sample&item_number=1414&shipping=0.00&no_shipping=0&no_note=1&currency_code=USD&tax=0.00&lc=US&bn=PP-BuyNowBF&submit=@$submit&return=@$ret";
			Post($vars, $url)or die("Error" . " File: " . __FILE__ . " on line: " . __LINE__);
?>

 

when i run this i just get a blank page with the error inside the die function.

 

I have a feeling the error is being caused by either one of the URL's inside $vars or the

email address inside $vars can anyone help me out with this?

Link to comment
https://forums.phpfreaks.com/topic/94915-curl-error-please-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.