Log In · Register

 
 
Reply to this topicStart new topic
whats the code for ..., :)
miszxjojo
post Mar 2 2009, 12:01 PM
Post #1


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



so you know on some sites they have these ads [other sites buttons] and when the page refreshes, theres a different button? what is the code for that? i found it once but i forgot where i found it :[
 
newkidontheblock
post Mar 2 2009, 01:24 PM
Post #2


Offline.
*****

Group: Official Designer
Posts: 609
Joined: Mar 2007
Member No: 507,591



Different people uses different things. Some people might use a PHP mysql database
and do something like this.
CODE
SELECT column FROM table
ORDER BY RAND()
LIMIT 1
http://www.petefreitag.com/item/466.cfm
 
Mikeplyts
post Mar 2 2009, 01:37 PM
Post #3


Mel Blanc was allergic to carrots.
*******

Group: Official Designer
Posts: 6,371
Joined: Aug 2008
Member No: 676,291



You can also try using this tutorial. thumbsup.gif
 
fixtatik
post Mar 4 2009, 04:17 PM
Post #4


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



there's also an older article about this on a list apart. it's written in PHP, so even if your visitors have javascript turned off, they'll still be able to see and click on the images. (that's assuming of course, you have PHP installed on your server.)
 
theerinkal
post Mar 7 2009, 03:08 PM
Post #5


Irrisistable Cabbages.
*****

Group: Member
Posts: 549
Joined: Nov 2007
Member No: 589,355



CODE




<script LANGUAGE="JavaScript">
<!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="URL HERE";
alt="Alt Text";
banner="BANNER URL HERE";
width="88";
height="34";
}
if (ad==2) {
url="URL HERE";
alt="Alt Text";
banner="BANNER URL HERE";
width="88";
height="34";
}
if (ad==3) {
url="URL HERE";
alt="Alt Text";
banner="BANNER URL HERE";
width="88";
height="34";
}
if (ad==4) {
url="URL HERE";
alt="Alt Text";
banner="BANNER URL HERE";
width="88";
height="34";
}

document.write('<a href="' + url + '" target="_blank">');
document.write('<img src="' + banner + '" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt="' + alt + '" border=0></a>');
// End -->
</SCRIPT>
 

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: