• 0

Random Banner Rotating Script


Question

Hi there,

I'm unsure if I'm clear with my explanation but I'll try my best.

Does anyone know of any (preferably free) script that will allow me to rotate other scripts?

I've got a spot on the top of my website and I wanted it to rotate banners from three seperate sources.

Google, Ad-Brite, and my own source.

So is there a script that would randomly select the google ad code or the ad-brite code and display it on top?

Many thanks in advance.

Kei

Link to comment
https://www.neowin.net/forum/topic/583507-random-banner-rotating-script/
Share on other sites

3 answers to this question

Recommended Posts

  • 0

using php, something like this maybe?

$array[0] = '<html code for google>';
$array[1] = '<html code for ad-brite>';
$array[2] = '<html code for yourself>';

shuffle($array);
echo $array[0]; //this will output the first element in the array (your html code) - remember it's just been shuffled so won't always be the google code

  php.net said:
Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically.

look at this page if your php version is too old and you need to use srand().

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.