I need a free ad banner rotator. Like a code that I can just insert in the ad space of my template.
Any suggestions????

Recommended Answers

All 6 Replies

Do you mean one that keeps rotating whilst the page is being used or one that displays a different ad(image) each time you refresh the page.

Do you mean one that keeps rotating whilst the page is being used or one that displays a different ad(image) each time you refresh the page.

Yes, thats what I meant.

Member Avatar for iamthwee

Ideally you would have the banner slideshow in either flash or javascript. Flash preferred.

Then on your side (i.e. on the server side) you would use a random script generated in php or something similar. Of course it could all be done on the client side using javascript - but I wouldn't.

I am very much not a fan of phpAdsNew. On all but the smallest sites it is rather sluggish, and the code is very inefficient. Unfortunately I don't have any other free solutions for you either, though.

I still can't tell whether you want to rotate an ad or a image?

If it is an image there are alot of codes on the web but this one may help you:

Put the following code where you would like the image to appear:

<script type="text/javascript" src="rand.js">

Then save the following javascript as "rand.js":

// JavaScript Document

var mess = new Array('<img src="pathtoimage.jpg" alt="IMAGE TItle" name="Name" width="276" height="181"/>','<img src="image_path.jpg" alt="Image Title" name="NAME" width="274" height="181"/>');
var max = mess.length;
var num = Math.floor((Math.random() * max));
document.writeln(mess[num]);

There are only two images here but you can use as many as you like, just seperate by comma.


Hope that helps you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.