Location: PHPKode > scripts > ICAN > afterpayprocessing.php
<? ob_start(); ?>
<?php
include("domaininfo.php");
?>
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html><head> 
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title><?php echo($maindomain); ?> - Earn Instant Commissions Digital Products!</title>
<link rel="stylesheet" type="text/css" href="style.css" media="all">
</head>
<body> 
<div style="text-align: center;"><br> 
<img alt="Instant Affiliate Commissions" src="images/mainlogo.jpg">&nbsp;<br> 
<br> 
<br> 
</div> 
<br>
<div style="margin-left:100px; margin-right:100px">
<font face="calibri" size="3">
<?php
include("pwd.php");
$result = mysql_query("SELECT * FROM payments where orderid = '$_SESSION[payorderid]'") or die(mysql_error());
$row = mysql_fetch_array($result);
$itemname = $row[itemname];
$itemnumber = $row[itemnumber];
$paystatus = $row[paystatus];
$payamt = $row[payamt];
$paycurrency = $row[paycurrency];
$tid = $row[tid];
$bemail = $row[bemail];
$pemail = $row[pemail];
$orderid = $row[customerorderid];
mysql_close();
if($paystatus=="completed")
{
$keycheck = "notapplicable";
while($keycheck!="")
{
$key = rand();
include("pwd.php");
$result = mysql_query("SELECT * FROM accesskey WHERE accesskey = '$key'") or die(mysql_error());
$row = mysql_fetch_array($result);
$keycheck = $row[pid];
mysql_close();
}
$accesskey = $key;
include("pwd.php");
mysql_query("INSERT INTO accesskey (accesskey, pid, used) VALUES('$accesskey','$_SESSION[pid]','no')") or die(mysql_error());
mysql_close();
$to = $_SESSION[cemail];
$subject = "Access Key For Your Order";
$message = "Visit ".$mainurl."/accessorder & use the following key to access your order: ".$accesskey;
$from = "support@".$maindomain;
$headers = "From: $from";
mail($to,$subject,$message,$headers);
include("pwd.php");
$result = mysql_query("SELECT * FROM members WHERE uname = '$_SESSION[tvendor]'") or die(mysql_error());
$row = mysql_fetch_array($result);
$vendoremail = $row[email];
mysql_close();
$to = $vendoremail;
$subject = "Hurray! New Order ID ".$orderid;
$message = "Now you can check the order details using order ID inside your ".$maindomain." vendor control panel. Order worth US $".$_SESSION[tprice];
$from = "support@".$maindomain;
$headers = "From: $from";
mail($to,$subject,$message,$headers);
header( 'Location: '.$mainurl.'/orderdelivered.php?accesskey='.$accesskey ) ;
}
else
echo("<b>Sorry, we could not process your payment!</b> Please contact support for manual payment verification. Please quote payment ID as ".$orderid);
?>
<br>
</font>
<h2><i>Questions? Need Support? Visit <a href="<?php echo($mainurl); ?>/support" target="_blank">www.<?php echo($maindomain); ?>/support</a></h2>
</div> 
<br> 
</body></html>
<? ob_flush(); ?>
Return current item: ICAN