/    Sign up×
Community /Pin to ProfileBookmark

Coupon generator

I’ve been hunting a script to make a coupon generator something like this [URL=”http://www.freewebs.com/targetcoupons/”]http://www.freewebs.com/targetcoupons/[/URL]

I have no idea what type of script it would be but I’m guessing javascript or php? Ok, I’m stupid, …. I know just enough to get into trouble :p

Can anyone point me in the right direction, obviously, it’s not called a coupon generator cause I’ve looked everywhere for one 😮 Thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@vwphillipsFeb 29.2008 — [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

function Init(zxccid,zxcpid){
var zxcc=document.getElementById(zxccid);
zxcc.print=document.getElementById(zxcpid);
var zxcimgs=zxcc.getElementsByTagName('IMG');
for (var zxc0=0;zxc0<zxcimgs.length;zxc0++){
zxcAddEvt(zxcimgs[zxc0],'zxcAddCoupon','click');
zxcES(zxcimgs[zxc0],{cursor:'pointer'});
}
}

function zxcAddCoupon(){
var zxcpage=this.parentNode;
var zxcprint=zxcpage.print;
var zxcnu=prompt('Enter the number of coupons','1');
zxcnu=zxcnu.replace(/D/g,'');
if (!zxcnu) return;
for (var zxc0=0;zxc0<parseInt(zxcnu);zxc0++){
zxcES(this.cloneNode(false),{},zxcprint);
}
zxcmore=confirm('OK for more.nCancel to Print');
if (!zxcmore){
if (zxcprint.getElementsByTagName('IMG').length<1) return;
zxcES(zxcpage,{display:'none'});
zxcES(zxcprint,{display:'block'});
}
}

function zxcES(zxcele,zxcstyle,zxcp,zxctxt){
if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
if (zxcp){ zxcp.appendChild(zxcele); }
if (zxctxt){ zxcele.appendChild(document.createTextNode(zxctxt)); }
return zxcele;
}

function zxcEventAdd(zxco,zxct,zxcf) {
if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ return zxco[zxcf](e);}, false); }
else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ return zxco[zxcf](e); }); }
else {
var zxcPrev=zxco["on" + zxct];
if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
else { zxco['on'+zxct]=zxco[zxcf]; }
}
}

function zxcAddEvt(zxcobj,zxcfun,zxcevt){
if (zxcobj['zxcadd'+zxcfun+zxcevt]) return;
zxcobj['zxcadd'+zxcfun+zxcevt]=window[zxcfun];
zxcEventAdd(zxcobj,zxcevt,'zxcadd'+zxcfun+zxcevt);
}




/*]]>*/
</script></head>

<body onload="Init('page','print')">
<div id="page" >
http://www.webdeveloper.com/forum/showthread.php?t=174940<br />
<img src="http://www.vicsjavascripts.org.uk/StdImages/One.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Two.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Three.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Four.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Five.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Six.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Seven.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Eight.gif" width="150" height="100" />
</div>
<div id="print" style="position:absolute;display:none;left:0px;top:0px;" ></div>


</body>

</html>[/CODE]
Copy linkTweet thisAlerts:
@silkypupauthorFeb 29.2008 — Holy moly, thank you so much! What the heck, it's like christmas here, you come in, have a problem and Santa delivers a big ole' present!!!?
Copy linkTweet thisAlerts:
@vwphillipsMar 06.2008 — responce to email

[CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

function Init(zxccid,zxcpid){
var zxcc=document.getElementById(zxccid);
zxcc.print=document.getElementById(zxcpid);
var zxcimgs=zxcc.getElementsByTagName('IMG');
for (var zxc0=0;zxc0<zxcimgs.length;zxc0++){
zxcAddEvt(zxcimgs[zxc0],'zxcAddCoupon','click');
zxcES(zxcimgs[zxc0],{cursor:'pointer'});
}
}

function zxcAddCoupon(){
var zxcpage=this.parentNode;
var zxcprint=zxcpage.print;
var zxcnu=prompt('Enter the number of coupons','1');
zxcnu=zxcnu.replace(/D/g,'');
if (!zxcnu) return;
for (var zxc0=0;zxc0<parseInt(zxcnu);zxc0++){
zxcES(this.cloneNode(false),{},zxcprint);
}
zxcmore=confirm('OK for more.nCancel to Print');
if (!zxcmore){
if (zxcprint.getElementsByTagName('IMG').length<1) return;
zxcES(zxcpage,{display:'none'});
zxcES(zxcprint,{display:'block'});
window.print();
zxcES(zxcpage,{display:'block'});
zxcES(zxcprint,{display:'none'});
while (zxcprint.firstChild) zxcprint.removeChild(zxcprint.firstChild);
}
}

function zxcES(zxcele,zxcstyle,zxcp,zxctxt){
if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
if (zxcp){ zxcp.appendChild(zxcele); }
if (zxctxt){ zxcele.appendChild(document.createTextNode(zxctxt)); }
return zxcele;
}

function zxcEventAdd(zxco,zxct,zxcf) {
if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ return zxco[zxcf](e);}, false); }
else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ return zxco[zxcf](e); }); }
else {
var zxcPrev=zxco["on" + zxct];
if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
else { zxco['on'+zxct]=zxco[zxcf]; }
}
}

function zxcAddEvt(zxcobj,zxcfun,zxcevt){
if (zxcobj['zxcadd'+zxcfun+zxcevt]) return;
zxcobj['zxcadd'+zxcfun+zxcevt]=window[zxcfun];
zxcEventAdd(zxcobj,zxcevt,'zxcadd'+zxcfun+zxcevt);
}




/*]]>*/
</script></head>

<body onload="Init('page','print')">
<div id="page" >
http://www.webdeveloper.com/forum/showthread.php?t=174940<br />
<img src="http://www.vicsjavascripts.org.uk/StdImages/One.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Two.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Three.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Four.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Five.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Six.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Seven.gif" width="150" height="100" />
<img src="http://www.vicsjavascripts.org.uk/StdImages/Eight.gif" width="150" height="100" />
</div>
<div id="print" style="position:absolute;display:none;left:0px;top:0px;" ></div>


</body>

</html>[/CODE]
Copy linkTweet thisAlerts:
@silkypupauthorMar 06.2008 — Thanks again!! You are amazing, and this is a wonderful thing you do for us people who can figure out how to do this ourselves. Thank you again
×

Success!

Help @silkypup spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...