"") { if ($refcheck) { if (strtolower($_GET['ref']) == "allrefs") { $listallrefs = true; $refexist = true; $listname = "All Referrals
"; } else { $listname = "Top ".$MAXtops." Referrals
"; } $displaylist = $listname.''; #$FH = fopen("data.txt", 'wb') or die("Can't Create file"); #hh if (file_exists("data.txt") == true) { $FH = fopen("data.txt", 'r') or die("Can't open file"); $data = fread($FH, filesize("data.txt")); fclose($FH); $lines = split(";", $data); rsort($lines, SORT_NUMERIC); foreach($lines as $line) { if (!($line == "")) { $listcount++; list($count, $exist) = split(",", $line); if (strtolower($_GET['ref']) == $exist){$count++; $refexist = true;} $stack .= $count.",".$exist.";"; if (($MAXcount < $MAXtops) or $listallrefs) { $MAXcount++; if ($listallrefs){$displaylist .= $listcount.") ";} $displaylist .= "".$exist." (".$count.")
"; } } } if ($refexist == false) { $stack .= "1,".strtolower($_GET['ref']).";"; if ($MAXcount < $MAXtops) { $MAXcount++; $displaylist .= "".strtolower($_GET['ref'])." (1)
"; } } if ($listallrefs == false) { $FH = fopen("data.txt", 'wb') or die("Can't Create file"); fwrite($FH, $stack); fclose($FH); } } else { $FH = fopen("data.txt", 'a') or die("Can't Create file"); fwrite($FH, "1,".strtolower($_GET['ref']).";"); fclose($FH); if ($MAXcount < $MAXtops) { $MAXcount++; $displaylist .= "".strtolower($_GET['ref'])." (1)
"; } } if ($listallrefs == false) { $displaylist .= "List All
"; } $displaylist .= '
'; $newOUTPUT = GETtemplate($displaylist); echo $newOUTPUT; exit; } else { $displaylist .= '

This is not a TRUE Referring URL!

'; $newOUTPUT = GETtemplate($displaylist); echo $newOUTPUT; exit; } } elseif (strpos($HTTPREFERER, $FIXEDADDRESS) == false) {echo "This script can only be used and is licensed to: ".$FIXEDADDRESS; exit;} if (strtolower($_POST['discode']) == "yes") { if (strtolower($_POST['discountnum']) == "") { SHOWFORM($_POST['discountnum'],""); exit; } else { CHECKDISCOUNT(); } } else { SENDOUTPUT($_POST['amount']); } //////////////////////////////////////////////////////////////////////// function CHECKDISCOUNT() { $codexist = false; // lower strtolower($_POST['discode']) == "yes") if ($_POST['discountnum'] == "PICKMEUP"){$codexist = true;} if ($_POST['discountnum'] == "EVEWEEKEND"){$codexist = true;} if ($_POST['discountnum'] == "BSTB"){$codexist = true;} if ($_POST['discountnum'] == "MSNBAL"){$codexist = true;} if ($_POST['discountnum'] == "CUSBAL"){$codexist = true;} if ($_POST['discountnum'] == "GTKBAL"){$codexist = true;} if (($_POST['discountnum'] == "PICKMEUP") or ($_POST['discountnum'] == "EVEWEEKEND") or ($_POST['discountnum'] == "MSNBAL")) { // $amount = $_POST['amount']; $disc = $amount / 100; $disc = $disc * 20; $amount = $amount - $disc; $amount = round($amount, 2); SENDOUTPUT($amount); exit; } elseif (($_POST['discountnum'] == "GTKBAL") or ($_POST['discountnum'] == "CUSBAL")) { $amount = $_POST['amount']; $disc = $amount / 100; $disc = $disc * 30; $amount = $amount - $disc; $amount = round($amount, 2); SENDOUTPUT($amount); exit; }//GTKBAL elseif (strtolower($_POST['item_number']) == "sw-e-01") { if ($_POST['discountnum'] == "BSTB") { $amount = $_POST['amount']; $disc = $amount / 100; $disc = $disc * 30; $amount = $amount - $disc; $amount = round($amount, 2); SENDOUTPUT($amount); exit; } else { SHOWFORM($_POST['discountnum'], "Sorry (".$_POST['discountnum'].") is the wrong code!
"); } } else { if ($codexist) { SHOWFORM($_POST['discountnum'], "Sorry (".$_POST['discountnum'].") this is the correct code but the wrong product!
"); } else { SHOWFORM($_POST['discountnum'], "Sorry (".$_POST['discountnum'].") is the wrong code!
"); } } } //////////////////////////////////////////////////////////////////////// function SHOWFORM($CODE, $MSG) { $add = $_POST['add']; $cmd = $_POST['cmd']; $business = $_POST['business']; $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $currency_code = $_POST['currency_code']; $amount = $_POST['amount']; $no_shipping = $_POST['no_shipping']; $no_note = $_POST['no_note']; $Input = $_POST['Input']; $lc = $_POST['lc']; $bn = $_POST['bn']; $discode = $_POST['discode']; $refpage = $_POST['refpage']; if ($refpage == ""){$refpage = $_SERVER["HTTP_REFERER"];} #$_POST['discountnum'] $newOUTPUT = ""; $newOUTPUT .= <<

Your item: $item_name usual price: $amount

$MSG Enter Your Discount Code:

Or Go Back to referring page!

Or Click below to pay regular price of $amount for $item_name

NEWOUT; $newOUTPUT = GETtemplate($newOUTPUT); print $newOUTPUT; exit; } //////////////////////////////////////////////////////////////// function SENDOUTPUT($PRICE) { $target = "https://www.paypal.com/cgi-bin/webscr"; $target .= "?add=".$_POST['add']; $target .= "&cmd=".$_POST['cmd']; $target .= "&business=".$_POST['business']; $target .= "&item_name=".$_POST['item_name']; $target .= "&item_number=".$_POST['item_number']; $target .= "&no_shipping=".$_POST['no_shipping']; $target .= "&no_note=".$_POST['no_note']; $target .= "¤cy_code=".$_POST['currency_code']; $target .= "&lc=".$_POST['lc']; $target .= "&bn=".$_POST['bn']; $target .= "&amount=".$PRICE; $header = "Location: $target\n\n"; header($header); Exit; } function GETtemplate($insert) { $outputtemp = ""; $outputtemp .= <<