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&business=myemail@yahoo.com&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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.