Location: PHPKode > scripts > ICAN > buy.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); ?> - Secure Order Form</title>
<link rel="stylesheet" type="text/css" href="style.css" media="all">
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false;}
else {return true}
}
}function validate_form(thisform)
{
with (thisform)
{
if (validate_required(name,"Name must be filled out!")==false||validate_required(email,"Email must be filled out!")==false||validate_required(plink,"Link for Product Sales Page must be filled out!")==false)
  {name.focus();return false;}
}
}
</script>
</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 color="blue">
<h2 align="center"><i>
<?php echo($maindomain); ?> Secure Order Form
<br><br>
<table width="100%">
<tr width="100%">
<td width="20%"></td>
<td width=20%">
<a href="https://www.paypal.com/verified"><img src="ppv.gif" border="0"></a>
</td>
<td width="20%">
<img src="apv.jpg"> 
</td>
<td width="20%">
<img src="GRKFg-128.gif">
</td>
<td width="20%">
</td>
</tr>
</table>
</i></h2>
</font>
<font face="calibri" size="3">
<?php
include("pwd.php");
$result = mysql_query("SELECT * FROM products WHERE pid = '$_GET[pid]'") or die(mysql_error());
$row = mysql_fetch_array($result);
$unitsavail = $row[unitsavail];
mysql_close();
if($unitsavail=="-1")
echo("<b>SORRY! This product has been SOLD OUT!</b>");
else
{
if($_SESSION[tpayto]=="" || $_SESSION[taffiliate]=="")
{
$_SESSION[tpayto] = "vendor";
$_SESSION[pid] = $_GET[pid];
$pid = $_GET[pid];
include("pwd.php");
$result = mysql_query("SELECT * FROM products WHERE pid = '$pid'") or die(mysql_error());
$row = mysql_fetch_array($result);
$_SESSION[tactive] = $row[active];
$_SESSION[tpname] = $row[pname];
$_SESSION[tplink] = $row[plink];
if($_GET[coupon]!="applied")
$_SESSION[tprice] = $row[price];
$_SESSION[tvendor] = $row[vendor];
$_SESSION[tpcomm] = $row[pcomm];
$_SESSION[currencycode] = $row[currencycode];
$_SESSION[trecurring] = $row[recurring];
if($_SESSION[trecurring]=="yes")
{
$_SESSION[trprice] = $row[rprice];
$_SESSION[trmonths] = $row[rmonths];
}
$_SESSION[tpthanks] = $row[pthanks];
$_SESSION[tptype] = $row[ptype];
mysql_close();
if($_SESSION[tactive]=="no")
echo("<b>This product is still waiting activation in Marketplace OR has been deactivated.<br><br></b>");
else
$active = "yes";
}
else
{
if($_SESSION[tactive]=="no")
echo("<b>This product is still waiting activation in Marketplace OR has been deactivated.<br><br></b>");
else
$active = "yes";
}
?>
<?php
if($active=="yes")
{
if($_GET[pid]!="")
{
if($_SESSION[pid]!=$_GET[pid])
{
header( 'Location: '.$mainurl.'/aff.php?pid='.$_GET[pid].'&id='.$_SESSION[taffiliate].'&forward=buy' ) ;
}
}
if($_SESSION[trecurring]!="yes" && $_SESSION[taffiliate]!="")
header( 'Location: '.$mainurl.'/buyplus.php?pid='.$_GET[pid].'&id='.$_SESSION[taffiliate].'&forward=buy' ) ;
?>

<?php
if($_GET[coupon]=="applied")
{
?>
<font color="red">
Coupon code has been applied to your purchase & your product price has been discounted below.<br><br>
</font>
<?php
}
?>

<?php
if($_GET[coupon]=="invalid")
{
?>
<font color="red">
The coupon code you entered is not valid or is not for this product. Please check & try again.<br><br>
</font>
<?php
}
?>

<?php
if($_GET[coupon]=="expired")
{
?>
<font color="red">
The coupon code you entered has been expired or reached its use limit. Sorry :(<br><br>
</font>
<?php
}
?>

Please enter your Name, Email, and Payment Method, then click "Proceed to payment".
<br><br>
<b>Product Name:</b> <?php echo($_SESSION[tpname]); ?><br>
<b>Product Price:</b> <?php echo($_SESSION[currencycode]); ?> <?php echo($_SESSION[tprice]); ?><br>
<br>
<form action="pay.php" method="post" onsubmit="return validate_form(this)">
<b>Enter your full name</b> <input type="text" name="name"><br><br>
<b>Enter your email</b> (very important so please double check)<br><input type="text" name="email"><br><br>
<b>Select Payment type</b><br>
<?php
if($_SESSION[tptype]=="paypal")
{
?>
<select name="ptype"><option value="paypal">Paypal (OR Credit Card)</option></select><br><br>
<?php
}
?>
<?php
if($_SESSION[tptype]=="lr")
{
?>
<select name="ptype"><option value="lr">Liberty Reserve</option></select><br><br>
<?php
}
?>
<?php
if($_SESSION[tptype]=="paypallr")
{
?>
<select name="ptype"><option value="paypal">Paypal (OR Credit Card)</option>
<option value="lr">Liberty Reserve</option></select><br><br>
<?php
}
?>
<input type="submit" value="Proceed to payment">
</form>
<?php
}
}
?>
<br><br>
<strong>Have a coupon?</strong> Enter it here: 
<form action="applycoupon.php?returnuri=buy.php?pid=<?php echo($_GET[pid]); ?>&pid=<?php echo($_GET[pid]); ?>" method="post"><input type="text" name="couponcode"> 
<input type="submit" value="Click here to apply!">
</form>
<br><br>
<p align="center"><font color="black"><b>[affiliate: <?php echo($_SESSION[taffiliate]); ?>]</b></font></p>
<br>
</font>
</div> 
<br> 
</body></html>
<? ob_flush(); ?>
Return current item: ICAN