You will need to add this code between
<html>
<head>
Place code here
</body>
</html>
</body>
</html>:
The code is...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>My Golf Stat Calculator</title>
<meta name="Microsoft Theme" content="evrgreen 1011, default">
</head>
<body>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
var discnt = 0; // no default percent discount
var coupons = new Array ( // place to put coupon codes
"coup1", // 1st coupon value - comma seperated
"coup2", // 2nd coupon value - add all you want
"coup3" // 3rd coupon value
);
var coupdc = new Array ( // place to put discounts for coupon vals
33.45,
33.35,
33.35
);
var coupval = "(blanket)"; // what user entered as coupon code
function ChkCoup () { // check user coupon entry
var i;
discnt = 0; // assume the worst
for (i=0; i<coupons.length; i++) {
if (coupval == coupons[i]) {
discnt = coupdc[i]; // remember the discount amt
alert ("Valid coupon number! \n\n" + discnt +
"% discount now in effect.");
return;
}
}
alert ("'" + coupval + "' is not a valid code!");
}
function Dollar (val) { // force to valid dollar amount
var str,pos,rnd=0;
if (val < .995) rnd = 1; // for old Netscape browsers
str = escape (val*1.0 + 0.005001 + rnd); // float, round, escape
pos = str.indexOf (".");
if (pos > 0) str = str.substring (rnd, pos + 3);
return str;
}
function ReadForm (obj1) { // apply the discount
var amt,des;
amt = obj1.baseamt.value*1.0; // base amount
des = obj1.basedes.value; // base description
if (discnt > 0) { // only if discount is active
amt = Dollar (amt - (amt * discnt/100.0));
des = des + ", " + discnt + "% dis, COUP = " + coupval;
}
obj1.amount.value = Dollar (amt);
obj1.item_name.value = des;
}
//-->
</script>
</head>
<body>
<form>
<input type = "text"
size = "10"
name = "coupcode"; />
<input type="button" value="Activate Coupon"
onclick="coupval = this.form.coupcode.value;
ChkCoup();" />
</form>
<form target="paypal" action="
https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target = 'paypal'; return ReadForm (this);">
<input type="image" src="images/btn_cart_**.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="images/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="yourname@yoursite">
<input type="hidden" name="item_name" value="Your Business Name">
<input type="hidden" name="item_number" value="Product number">
<input type="hidden" name="amount" value="14.95">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="
http://www.yourreturnsite.com">
<input type="hidden" name="cancel_return" value="
http://www.yourcancelsite.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
<input type="hidden" name="baseamt" value="14.95" />
<input type="hidden" name="basedes" value="Your product
name@14.95" />
</form>
<form target="paypal" action="
https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="
youremail@youremail.com">
<input type="image" src="images/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
<input type="hidden" name="page_style" value="Primary">
</form>
This is not my code, as I pulled this off of the internet. You will need to edit it to for your personal use. Tip 1. Do not add lines to the code or the amount. Simply add to the existing line. Remember the discounts are in % format so simple math skills will help. For example:
"coup1", "
Coup4", These are the names of your coupons. You will need to
"coup2", change the names.
"coup3"
33.45,
50, You will need to add a corresponding discount. 33.45,
33.45