Northern Flame Posted March 7, 2008 Share Posted March 7, 2008 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¤cy_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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.