mlynch1985 Posted December 6, 2008 Share Posted December 6, 2008 Hi Guys/Gals. I have an MAJOR issue with Paypal/IPN and cURL. The scripts I have were working on a different server and I believe the paypal data is getting as far as the IPN page, however the IPN doesnt update the SQL database. I think its a cURL configuration or PHP configuration issue. Anyhows, here are the scripts. I am true to my word so the first person to solve this I will send £40 via Paypal within the hour. IPN Script: <?php /* * ipn.php * * PHP Toolkit for PayPal v0.51 * http://www.paypal.com/pdn * * Copyright (c) 2004 PayPal Inc * * Released under Common Public License 1.0 * http://opensource.org/licenses/cpl.php * */ //get global configuration information include_once('../includes/global_config.inc.php'); //get pay pal configuration file include_once('../includes/config.inc.php'); //decide which post method to use switch($paypal[post_method]) { case "libCurl": //php compiled with libCurl support $result=libCurlPost($paypal[url],$_POST); break; case "curl": //cURL via command line $result=curlPost($paypal[url],$_POST); break; case "fso": //php fsockopen(); $result=fsockPost($paypal[url],$_POST); break; default: //use the fsockopen method as default post method $result=fsockPost($paypal[url],$_POST); break; } //check the ipn result received back from paypal if(eregi("VERIFIED",$result)) { include_once('./ipn_success.php'); } else { include_once('./ipn_error.php'); } ?> ---------- IPNSuccess Script: <?php /* * ipn_success.php * * PHP Toolkit for PayPal v0.51 * http://www.paypal.com/pdn * * Copyright (c) 2004 PayPal Inc * * Released under Common Public License 1.0 * http://opensource.org/licenses/cpl.php * */ //include file - not accessible directly if(isset($paypal['business'])) { //log successful transaction to file or database } else { die('This page is not directly accessible'); } ?> ----- IPN Error Script: <?php /* * ipn_error.php * * PHP Toolkit for PayPal v0.51 * http://www.paypal.com/pdn * * Copyright (c) 2004 PayPal Inc * * Released under Common Public License 1.0 * http://opensource.org/licenses/cpl.php * */ // this is an include file - no functionality when // called directly if(isset($paypal['business'])) { //log error to file or database } else { die('This page is not directly accessible'); } ?> ---- Config Script: <?php /* * config.inc.php * * PHP Toolkit for PayPal v0.51 * http://www.paypal.com/pdn * * Copyright (c) 2004 PayPal Inc * * Released under Common Public License 1.0 * http://opensource.org/licenses/cpl.php * */ //Configuration Settings $paypal[business]="service@footballadvisers.com"; $paypal[site_url]="http://www.footballadvisers.com/"; $paypal[image_url]=""; $paypal[success_url]="transaction/" . $uniqueid; //$paypal[success_url]="php_paypal/ipn/ipn.php"; $paypal[cancel_url]="cancelled/"; $paypal[notify_url]="paypal/ipn/ipn.php"; $paypal[return_method]="2"; //1=GET 2=POST $paypal[currency_code]="GBP"; //[uSD,GBP,JPY,CAD,EUR] $paypal[lc]="US"; //$paypal[url]="http://www.paypal.com/cgi-bin/webscr"; $paypal[url]="https://www.sandbox.paypal.com/cgi-bin/webscr"; //$paypal[url]="https://www.sandbox.paypal.com/cgi-bin/webscr"; $paypal[post_method]="fso"; //fso='ssl://www.paypal.com', 443, $errno, $errstr, 30); curl=curl command line libCurl=php compiled with libCurl support $paypal[curl_location]="/usr/bin/curl"; $paypal[bn]="toolkit-php"; $paypal[cmd]="_xclick"; //Payment Page Settings $paypal[display_comment]="0"; //0=yes 1=no $paypal[comment_header]="Comments"; $paypal[continue_button_text]="Continue >>"; $paypal[background_color]=""; //""=white 1=black $paypal[display_shipping_address]=""; //""=yes 1=no $paypal[display_comment]="1"; //""=yes 1=no //Product Settings $paypal[item_name]="$_POST[item_name]"; $paypal[item_number]="$_POST[item_number]"; $paypal[amount]="$_POST[amount]"; $paypal[on0]="$_POST[on0]"; $paypal[os0]="$_POST[os0]"; $paypal[on1]="$_POST[on1]"; $paypal[os1]="$_POST[os1]"; $paypal[quantity]="$_POST[quantity]"; $paypal[edit_quantity]=""; //1=yes ""=no $paypal[invoice]="$_POST[invoice]"; $paypal[tax]="$_POST[tax]"; //Customer Settings $paypal[firstname]="$_POST[firstname]"; $paypal[lastname]="$_POST[lastname]"; $paypal[address1]="$_POST[address1]"; $paypal[address2]="$_POST[address2]"; $paypal[city]="$_POST[city]"; $paypal[state]="$_POST[state]"; $paypal[zip]="$_POST[zip]"; $paypal[email]="$_POST[email]"; $paypal[phone_1]="$_POST[phone1]"; $paypal[phone_2]="$_POST[phone2]"; $paypal[phone_3]="$_POST[phone3]"; ?> ------------------- Global config Script: <?php /* * global_config.inc.php * * PHP Toolkit for PayPal v0.51 * http://www.paypal.com/pdn * * Copyright (c) 2004 PayPal Inc * * Released under Common Public License 1.0 * http://opensource.org/licenses/cpl.php * */ //create variable names to perform additional order processing function create_local_variables() { $array_name[business]="$_POST[business]"; $array_name[receiver_email]="$_POST[receiver_email]"; $array_name[receiver_id]="$_POST[receiver_id]"; $array_name[item_name]="$_POST[item_name]"; $array_name[item_number]="$_POST[item_number]"; $array_name[quantity]="$_POST[quantity]"; $array_name[invoice]="$_POST[invoice]"; $array_name[custom]="$_POST[custom]"; $array_name[memo]="$_POST[memo]"; $array_name[tax]="$_POST[tax]"; $array_name[option_name1]="$_POST[option_name1]"; $array_name[option_selection1]="$_POST[option_selection1]"; $array_name[option_name2]="$_POST[option_name2]"; $array_name[option_selection2]="$_POST[option_selection2]"; $array_name[num_cart_items]="$_POST[num_cart_items]"; $array_name[mc_gross]="$_POST[mc_gross]"; $array_name[mc_fee]="$_POST[mc_fee]"; $array_name[mc_currency]="$_POST[mc_currency]"; $array_name[settle_amount]="$_POST[settle_amount]"; $array_name[settle_currency]="$_POST[settle_currency]"; $array_name[exchange_rate]="$_POST[exchange_rate]"; $array_name[payment_gross]="$_POST[payment_gross]"; $array_name[payment_fee]="$_POST[payment_fee]"; $array_name[payment_status]="$_POST[payment_status]"; $array_name[pending_reason]="$_POST[pending_reason]"; $array_name[reason_code]="$_POST[reason_code]"; $array_name[payment_date]="$_POST[payment_date]"; $array_name[txn_id]="$_POST[txn_id]"; $array_name[txn_type]="$_POST[txn_type]"; $array_name[payment_type]="$_POST[payment_type]"; $array_name[for_auction]="$_POST[for_auction]"; $array_name[auction_buyer_id]="$_POST[auction_buyer_id]"; $array_name[auction_closing_date]="$_POST[auction_closing_date]"; $array_name[auction_multi_item]="$_POST[auction_multi_item]"; $array_name[first_name]="$_POST[first_name]"; $array_name[last_name]="$_POST[last_name]"; $array_name[payer_business_name]="$_POST[payer_business_name]"; $array_name[address_name]="$_POST[address_name]"; $array_name[address_street]="$_POST[address_street]"; $array_name[address_city]="$_POST[address_city]"; $array_name[address_state]="$_POST[address_state]"; $array_name[address_zip]="$_POST[address_zip]"; $array_name[address_country]="$_POST[address_country]"; $array_name[address_status]="$_POST[address_status]"; $array_name[payer_email]="$_POST[payer_email]"; $array_name[payer_id]="$_POST[payer_id]"; $array_name[payer_status]="$_POST[payer_status]"; $array_name[notify_version]="$_POST[notify_version]"; $array_name[verify_sign]="$_POST[verify_sign]"; return $array_name; } //post transaction data using curl function curlPost($url,$data) { global $paypal; //build post string foreach($data as $i=>$v) { $postdata.= $i . "=" . urlencode($v) . "&"; } $postdata.="cmd=_notify-validate"; //execute curl on the command line exec("$paypal[curl_location] -d \"$postdata\" $url", $info); $info=implode(",",$info); return $info; } //posts transaction data using libCurl function libCurlPost($url,$data) { //build post string foreach($data as $i=>$v) { $postdata.= $i . "=" . urlencode($v) . "&"; } $postdata.="cmd=_notify-validate"; $ch=curl_init(); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,1); curl_setopt($ch,CURLOPT_POSTFIELDS,$postdata); //Start ob to prevent curl_exec from displaying stuff. ob_start(); curl_exec($ch); //Get contents of output buffer $info=ob_get_contents(); curl_close($ch); //End ob and erase contents. ob_end_clean(); return $info; } //posts transaction data using fsockopen. function fsockPost($url,$data) { //Parse url $web=parse_url($url); //build post string foreach($data as $i=>$v) { $postdata.= $i . "=" . urlencode($v) . "&"; } $postdata.="cmd=_notify-validate"; //Set the port number if($web[scheme] == "https") { $web[port]="443"; $ssl="ssl://"; } else { $web[port]="80"; } //Create paypal connection $fp=@fsockopen($ssl . $web[host],$web[port],$errnum,$errstr,30); //Error checking if(!$fp) { echo "$errnum: $errstr"; } //Post Data else { fputs($fp, "POST $web[path] HTTP/1.1\r\n"); fputs($fp, "Host: $web[host]\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-length: ".strlen($postdata)."\r\n"); fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, $postdata . "\r\n\r\n"); //loop through the response from the server while(!feof($fp)) { $info[]=@fgets($fp, 1024); } //close fp - we are done with it fclose($fp); //break up results into a string $info=implode(",",$info); } return $info; } //Display Paypal Hidden Variables function showVariables() { global $paypal; ?> <!-- PayPal Configuration --> <input type="hidden" name="business" value="<?=$paypal[business]?>"> <input type="hidden" name="cmd" value="<?=$paypal[cmd]?>"> <input type="hidden" name="image_url" value="<? echo "$paypal[site_url]$paypal[image_url]"; ?>"> <input type="hidden" name="return" value="<? echo "$paypal[site_url]$paypal[success_url]"; ?>"> <input type="hidden" name="cancel_return" value="<? echo "$paypal[site_url]$paypal[cancel_url]"; ?>"> <input type="hidden" name="notify_url" value="<? echo "$paypal[site_url]$paypal[notify_url]"; ?>"> <input type="hidden" name="rm" value="<?=$paypal[return_method]?>"> <input type="hidden" name="currency_code" value="<?=$paypal[currency_code]?>"> <input type="hidden" name="lc" value="<?=$paypal[lc]?>"> <input type="hidden" name="bn" value="<?=$paypal[bn]?>"> <input type="hidden" name="cbt" value="<?=$paypal[continue_button_text]?>"> <!-- Payment Page Information --> <input type="hidden" name="no_shipping" value="<?=$paypal[display_shipping_address]?>"> <input type="hidden" name="no_note" value="<?=$paypal[display_comment]?>"> <input type="hidden" name="cn" value="<?=$paypal[comment_header]?>"> <input type="hidden" name="cs" value="<?=$paypal[background_color]?>"> <!-- Product Information --> <input type="hidden" name="item_name" value="<?=$paypal[item_name]?>"> <input type="hidden" name="amount" value="<?=$paypal[amount]?>"> <input type="hidden" name="quantity" value="<?=$paypal[quantity]?>"> <input type="hidden" name="item_number" value="<?=$paypal[item_number]?>"> <input type="hidden" name="undefined_quantity" value="<?=$paypal[edit_quantity]?>"> <input type="hidden" name="on0" value="<?=$paypal[on0]?>"> <input type="hidden" name="os0" value="<?=$paypal[os0]?>"> <input type="hidden" name="on1" value="<?=$paypal[on1]?>"> <input type="hidden" name="os1" value="<?=$paypal[os1]?>"> <!-- Shipping and Misc Information --> <input type="hidden" name="shipping" value="<?=$paypal[shipping_amount]?>"> <input type="hidden" name="shipping2" value="<?=$paypal[shipping_amount_per_item]?>"> <input type="hidden" name="handling" value="<?=$paypal[handling_amount]?>"> <input type="hidden" name="tax" value="<?=$paypal[tax]?>"> <input type="hidden" name="custom" value="<?=$paypal[custom_field]?>"> <input type="hidden" name="invoice" value="<?=$paypal[invoice]?>"> <!-- Customer Information --> <input type="hidden" name="first_name" value="<?=$paypal[firstname]?>"> <input type="hidden" name="last_name" value="<?=$paypal[lastname]?>"> <input type="hidden" name="address1" value="<?=$paypal[address1]?>"> <input type="hidden" name="address2" value="<?=$paypal[address2]?>"> <input type="hidden" name="city" value="<?=$paypal[city]?>"> <input type="hidden" name="state" value="<?=$paypal[state]?>"> <input type="hidden" name="zip" value="<?=$paypal[zip]?>"> <input type="hidden" name="email" value="<?=$paypal[email]?>"> <input type="hidden" name="night_phone_a" value="<?=$paypal[phone_1]?>"> <input type="hidden" name="night_phone_b" value="<?=$paypal[phone_2]?>"> <input type="hidden" name="night_phone_c" value="<?=$paypal[phone_3]?>"> <?php } ?> ------------------ All I have changed is the root to cURL as my cURL is located as usr/bin/curl when it was prev usr/local/bin/curl on the original script. Didnt work with the other location either so it cant be this. Any questions I'll be online here as I need this sorting today, clients walking out the door etc :> Ready, Set.....GO! Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/ Share on other sites More sharing options...
balistic Posted December 6, 2008 Share Posted December 6, 2008 were the versions of php different? Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707595 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 were the versions of php different? I'm not sure, I know my current host sets default to php5 and we can use php4 etc if we; Q. How do I use PHP5/PHP4? A. PHP5 is enabled by default, PHP4 can be enabled by using the .php4 extension or add a .htaccess file in your folder with the line: AddHandler application/x-httpd-php4 .php .php4 .php3 .phtml Cheers, Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707598 Share on other sites More sharing options...
balistic Posted December 6, 2008 Share Posted December 6, 2008 try running php4 because i think theres some syntax changes i see in there Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707603 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 try running php4 because i think theres some syntax changes i see in there I;ve added the line to the .htaccess and the homepage doesnt let you login now: Warning: session_start() [function.session-start]: open(/tmp/sess_fbb5140a7450eed21d99697b2fd78532, O_RDWR) failed: Permission denied (13) in /home/betclcom/public_html/footballadvisers.com/index.php on line 4 Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707611 Share on other sites More sharing options...
GingerRobot Posted December 6, 2008 Share Posted December 6, 2008 I would start by adding these two lines to the top of your script: error_reporting(E_ALL); ini_set('display_errors','On'); This will mean you'll actually be seeing all of the error messages. For starters, you'll get a whole host of undefined constant messages for these lines: $array_name[business]="$_POST[business]"; Since the key of the array should be quoted, like so: $array_name['business']=$_POST['business']; Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707613 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 Not a single line in the code you posted has anything to do with MySQL. And I see nothing that would not work in PHP5 here. Do you get any error messages? Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707617 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 Not a single line in the code you posted has anything to do with MySQL. And I see nothing that would not work in PHP5 here. Do you get any error messages? <?php include('include/config.php'); //Array ( [p] => transaction [unique_id] => 11775 [mc_gross] => 0.99 [address_status] => confirmed [payer_id] => 94VEYGKNGKHL4 [tax] => 0.00 [address_street] => 39 lorne road [payment_date] => 15:46:12 Oct 22, 2007 PDT [payment_status] => Completed [charset] => windows-1252 [address_zip] => ha3 7nh [first_name] => Eimantas [mc_fee] => 0.34 [address_country_code] => GB [address_name] => CLANNED.COM [notify_version] => 2.4 [custom] => [payer_status] => verified [business] => andrewmalecha@hotmail.com [address_country] => United Kingdom [address_city] => london [quantity] => 1 [payer_email] => me@eimantas.com [verify_sign] => AJimJXiQSlZfm5u0TF0QZd7zwTkCAQq2Hna2HaTfItpROB1JNPuIYXFp [txn_id] => 6V249714A4487505X [payment_type] => instant [payer_business_name] => CLANNED.COM [last_name] => Sipas [address_state] => england [receiver_email] => andrewmalecha@hotmail.com [payment_fee] => 0.34 [receiver_id] => BFTEYADYLF9TG [txn_type] => web_accept [item_name] => CollegeCappers.com Lock Club [mc_currency] => USD [item_number] => [residence_country] => GB [payment_gross] => 0.99 [shipping] => 0.00 ) if($_REQUEST['payment_status'] == 'Completed') { /* get temp order information */ $random_id = $_REQUEST['unique_id']; if ($random_id <= 20000) { $query = mysql_query("SELECT * FROM orders_temp WHERE random_id = '$random_id'"); if(mysql_num_rows($query) == 0) { print '<h1>Error</h1>There was a problem processing your order, are you sure you made your payment? Contact Administrator.'; return; } $row = mysql_fetch_object($query); /* process new order */ $user_id = $row->user_id; $package_id = $row->package_id; $price_id = $row->price_id; $pick_id = $row->pick_id; $pick_price = $row->pick_price; $type = $row->type; $added = $row->time_added; /* if package, get start and end dates */ if($type == 1) { /* get package info */ $q2 = mysql_query("SELECT * FROM x_pack_prices WHERE id = '$price_id'"); $prices = mysql_fetch_object($q2); /* set starting and ending dates */ if($prices->season == 0) { $date_start = $added; $date_end = $added + ($prices->length * 24 * 60 * 60); } else { $date_start = $prices->dstart; $date_end = $prices->dend; } $package_price = $prices->value; $insert = mysql_query("INSERT INTO orders (user_id,package_id,package_price,price_id,type,dstart,dend) VALUES ('$user_id','$package_id','$package_price','$price_id','$type','$date_start','$date_end')"); $order_id = mysql_insert_id(); /* if single pick, dont add dates */ } else { $trans_date = time(); $insert = mysql_query("INSERT INTO orders (user_id,pick_id,pick_price,type,transaction) VALUES ('$user_id','$pick_id','$pick_price','$type','$trans_date')"); $order_id = mysql_insert_id(); } // paypal transaction id $transaction_id = $_REQUEST['txn_id']; $to = 'matt.lynch@footballadvisers.com'; $subject = 'Number1BETS order'; $message = 'NEW ORDER! Order Id: ' . $order_id . ' , Amount Paid: ' . $_REQUEST['payment_gross']; $headers = 'From: service@footballadvisers.com' . "\r\n" . 'Reply-To: service@footballadvisers.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> <style type="text/css"> <!-- .style1 {color: #336699} --> </style> <h1 class="style1">Order Completed</h1> <strong>Thank you, your order has now been completed.</strong> <br /><br /> Your Order ID: <? print $order_id; ?> and Transaction ID: <? print $transaction_id; ?> <br /><br /> Please keep this information safe, and provide them if you are making a query regarding your purchase, thank you. <?php } else { $query = mysql_query("SELECT * FROM orders_special_temp WHERE random_id = '$random_id'"); if(mysql_num_rows($query) == 0) { print '<h1>Error</h1>There was a problem processing your order, are you sure you made your payment? Contact Administrator.'; return; } $row = mysql_fetch_object($query); /* process new order */ $user_id = $row->user_id; $package_id = $row->package_id; $package_price = $row->package_price; $trans_date = time(); $insert = mysql_query("INSERT INTO orders_special (user_id,package_id,package_price,transaction) VALUES ('$user_id','$package_id','$package_price','$trans_date')"); $order_id = mysql_insert_id(); // paypal transaction id $transaction_id = $_REQUEST['txn_id']; $to = 'matt.lynch@footballadvisers.com'; $subject = 'Number1BETS order'; $message = 'NEW ORDER! Order Id: ' . $order_id . ' , Amount Paid: ' . $_REQUEST['payment_gross']; $headers = 'service@footballadvisers.com' . "\r\n" . 'Reply-To: service@footballadvisers.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> <h1 class="style1">Order Completed</h1> <strong>Thank you, your order has now been completed.</strong> <br /><br /> Your Order ID: <? print $order_id; ?> and Transaction ID: <? print $transaction_id; ?> <br /><br /> Please keep this information safe, and provide them if you are making a query regarding your purchase, thank you. <?php } } ?> This is where the SQL comes into play. This is the return page from Paypal. Get no error messages on this page, just the index.php= and then blank where the includes should be the transaction page. Cheers,[/code] Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707625 Share on other sites More sharing options...
balistic Posted December 6, 2008 Share Posted December 6, 2008 a lot of servers have exec() disabled for security reasons, you might want to check that its available to use. Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707631 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 Go with GingerRobot's hints for starters Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707632 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 a lot of servers have exec() disabled for security reasons, you might want to check that its available to use. My host seems to have this open: Q: I have uploaded a video but I can’t play it, it is not converting and stuck on buffering A: Check if you have ALL required modules installed and configured on your server. Check if the paths to the module binaries are set correctly in config.php. 1) Check if there are any .flv or x.flv files in /flvideo folder. 2) You can try changing this line in convert.php(Clipshare Pro) or upload.php(Clipshare Regular): find: exec("flvtool2 -Uv $config[flvdodir]/".$vid."x.flv $config[flvdodir]/".$vid.".flv"); and change to exec("$config[metainject] -Uv $config[flvdodir]/".$vid."x.flv $config[flvdodir]/".$vid.".flv"); EXAMPLE*** comment out old one, replace //update flv metatags //exec("flvtool2 -Uv $config[flvdodir]/".$vid."x.flv $config[flvdodir]/".$vid.".flv"); exec("$config[metainject] -Uv $config[flvdodir]/".$vid."x.flv $config[flvdodir]/".$vid.".flv"); ------------------------------------------- Q: I get a „Failed to find flength file†error in progress bar A: Edit .htaccess and add the following code: # Turn off mod_security filtering. SecFilterEngine Off # The below probably isn't needed, # but better safe than sorry. SecFilterScanPOST Off or follow complete instructions for .htaccess Cheers Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707648 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 I would start by adding these two lines to the top of your script: error_reporting(E_ALL); ini_set('display_errors','On'); This will mean you'll actually be seeing all of the error messages. For starters, you'll get a whole host of undefined constant messages for these lines: $array_name[business]="$_POST[business]"; Since the key of the array should be quoted, like so: $array_name['business']=$_POST['business']; I have done this as suggested. Still returning to this:http://www.footballadvisers.com/transaction/10718 i.e transaction is 10718. should not be blank and SQL still not updated. :'( Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707651 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 add the error_reporting(E_ALL); ini_set('display_errors','On'); to the transaction page and get the following error: if($_REQUEST['payment_status'] == 'Completed') updated the code to: if($_REQUEST['payment_status'] = 'Completed') as the == is nonsense, the page updates the SQL now, following errors on the transaction page look like this: Notice: Undefined index: txn_id in /home/betclcom/public_html/footballadvisers.com/_pages/transaction.php on line 68 Notice: Undefined index: payment_gross in /home/betclcom/public_html/footballadvisers.com/_pages/transaction.php on line 72 Order Completed Thank you, your order has now been completed. Your Order ID: 2 and Transaction ID: Please keep this information safe, and provide them if you are making a query regarding your purchase, thank you. Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707662 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 as the == is nonsense, No it is not. It is a comaprison operator, it compares $_REQUEST['payment_status'] to 'Completed' Now that you changed it to = which is an assignment operator, it will always set $_REQUEST['payment_status'] to 'Completed' (and will go into if block) What was the error you got, you seem to forgot to paste it. Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707664 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 as the == is nonsense, No it is not. It is a comaprison operator, it compares $_REQUEST['payment_status'] to 'Completed' Now that you changed it to = which is an assignment operator, it will always set $_REQUEST['payment_status'] to 'Completed' (and will go into if block) What was the error you got, you seem to forgot to paste it. OH. The error prior to me deleting the == was: Notice: Undefined index: payment_status in /home/betclcom/public_html/footballadvisers.com/_pages/transaction.php on line 8 Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707668 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 as the == is nonsense, No it is not. It is a comaprison operator, it compares $_REQUEST['payment_status'] to 'Completed' Now that you changed it to = which is an assignment operator, it will always set $_REQUEST['payment_status'] to 'Completed' (and will go into if block) What was the error you got, you seem to forgot to paste it. OH. The error prior to me deleting the == was: Notice: Undefined index: payment_status in /home/betclcom/public_html/footballadvisers.com/_pages/transaction.php on line 8 Line 8 being: if($_REQUEST['payment_status'] == 'Completed') Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707670 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 You're not using cUrl in fact. This script is configured to use fsockopen Please search the line //Create paypal connection $fp=@fsockopen($ssl . $web[host],$web[port],$errnum,$errstr,30); in global_config.inc.php and change it to //Create paypal connection $fp=fsockopen($ssl . $web[host],$web[port],$errnum,$errstr,30); (remove @, so that it will display an error if something goes wrong) [edit] And change this = back to == Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707672 Share on other sites More sharing options...
webmaster1 Posted December 6, 2008 Share Posted December 6, 2008 Mchl & Ginger will be splitting the cash with me by the way. I'm secretly their mentor. Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707680 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 You're not using cUrl in fact. This script is configured to use fsockopen Please search the line //Create paypal connection $fp=@fsockopen($ssl . $web[host],$web[port],$errnum,$errstr,30); in global_config.inc.php and change it to //Create paypal connection $fp=fsockopen($ssl . $web[host],$web[port],$errnum,$errstr,30); (remove @, so that it will display an error if something goes wrong) [edit] And change this = back to == did this, just comes back the the transaction page with the line 8 error. Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707685 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 Strange... BTW: Check if you have this line allow_url_fopen = On in php.ini It is required for fsockopen to work with remote urls Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707688 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 Strange... BTW: Check if you have this line allow_url_fopen = On in php.ini It is required for fsockopen to work with remote urls I dont have a php.ini only .htaccess Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707697 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 Upload this script: <?php phpinfo(); ?> run it in the browser and search for 'allow_url_fopen' Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707701 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 Upload this script: <?php phpinfo(); ?> run it in the browser and search for 'allow_url_fopen' allow_url_fopen On On - Showing as open http://www.footballadvisers.com/_pages/red.php Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707706 Share on other sites More sharing options...
Mchl Posted December 6, 2008 Share Posted December 6, 2008 It is enabled then... I'm running out of ideas... Since your host has libCurl enabled, you might want to change $paypal[post_method]="fso"; to $paypal[post_method]="libCurl"; in your conig.inc.php Maybe this will work... I don;t know really. Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707721 Share on other sites More sharing options...
mlynch1985 Posted December 6, 2008 Author Share Posted December 6, 2008 It is enabled then... I'm running out of ideas... Since your host has libCurl enabled, you might want to change $paypal[post_method]="fso"; to $paypal[post_method]="libCurl"; in your conig.inc.php Maybe this will work... I don;t know really. nope, tried libcurl and curl. Still coming up with the line 8 error. aRRRGH! What a nightmare Quote Link to comment https://forums.phpfreaks.com/topic/135792-paypal-ipn-curl-issue-%C2%A340-via-paypal-today-for-the-man-who-solves-it/#findComment-707735 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.