<?php
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))

ob_start("ob_gzhandler");

else

ob_start();

header ("cache-control: must-revalidate");

$offset = 60 * 60 *60;

$expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";

header ($expire);

session_start();

$stack = array();

foreach ($_REQUEST as $key =&gt; $value)

{

$stack[$key]=$value;

}

require_once('paypal.class.php');

$p = new paypal_class;             // initiate an instance of the class

//require_once("admin-manual/inc/config.inc.php");

require_once("dbconect.php");

//require_once("admin-manual/inc/functions.inc.php");

$db_settings = new Database();

$db_settings-&gt;open();

$nowtimedt = date( 'Y-m-d H:i:s');

$sdfsdfsdfsdnum = rand(111113454, 8890980980);

$updatecane_order="update  `cart` set mail ='".$stack['receiver_email']."',gen_no='". $sdfsdfsdfsdnum."', proprice       ='".$stack['payment_gross']."', p_dt='".$nowtimedt ."',     pay_act='Y' where cartid='".$stack['item_number']."'";

mysql_query($updatecane_order);

$insertpaypal="insert into gft_paypal set `mc_gross`='".$stack['mc_gross']."' ,`protection_eligibility`='".$stack['protection_eligibility']."',`address_status`='".$stack['address_status']."', `payer_id`='".$stack['payer_id']."',`tax`='".$stack['tax']."',`address_street`='".$stack['address_street']."',`payment_date`='".$stack['payment_date']."',`payment_status`='".$stack['payment_status']."',`charset`='".$stack['charset']."', `address_zip`='".$stack['address_zip']."',`first_name`='".$stack['first_name']."',`mc_fee`='".$stack['mc_fee']."',`address_country_code`='".$stack['address_country_code']."',`address_name`='".$stack['address_name']."',`notify_version`='".$stack['notify_version']."',`custom`='".$stack['custom']."',`payer_status` ='".$stack['payer_status']."',`business`='".$stack['business']."',`address_country`='".$stack['address_country']."',`address_city`='".$stack['address_city']."',`quantity`='".$stack['quantity']."',`verify_sign`='".$stack['verify_sign']."',`payer_email`='".$stack['payer_email']."',`txn_id`='".$stack['txn_id']."',`payment_type`='".$stack['payment_type']."',`last_name`='".$stack['last_name']."',`address_state`='".$stack['address_state']."',`receiver_email`='".$stack['receiver_email']."',`payment_fee`='".$stack['payment_fee']."',`receiver_id`='".$stack['receiver_id']."',`txn_type`='".$stack['txn_type']."',`item_name`='".$stack['item_name']."',`mc_currency`='".$stack['mc_currency']."',`item_number`='".$stack['item_number']."', `residence_country`='".$stack['residence_country']."',`test_ipn`='".$stack['test_ipn']."',`handling_amount`='".$stack['handling_amount']."',`transaction_subject`='".$stack['transaction_subject']."',`payment_gross`='".$stack['payment_gross']."',`shipping`='".$stack['shipping']."'";

mysql_query($insertpaypal);

$getrowid = $stack['item_number'];

$subject = 'Instant Payment Notification - Recieved Payment, ,your TXN  '.$stack['txn_id'];

$to = $rowsdf['admin_mail'];    //  your email

$body =  "An instant payment notification was successfully recieved\n";

$body .= "from ".$p-&gt;ipn_data['payer_email']." on ".date('m/d/Y');

$body .= " at ".date('g:i A')."\n\nDetails:\n";

foreach ($p-&gt;ipn_data as $key =&gt; $value)

{

$body .= "\n$key: $value";

$stack[$key]=$value;

}

echo “Payment Completed successfully”;

?>