Amnesia Posted August 24, 2007 Share Posted August 24, 2007 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 More sharing options...
0 marc2003 Posted August 24, 2007 Share Posted August 24, 2007 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(). Link to comment https://www.neowin.net/forum/topic/583507-random-banner-rotating-script/#findComment-588804017 Share on other sites More sharing options...
0 Amnesia Posted August 24, 2007 Author Share Posted August 24, 2007 thank you very much for your advice. I'll try to implement your idea right now and get back right away. Many thanks. Link to comment https://www.neowin.net/forum/topic/583507-random-banner-rotating-script/#findComment-588804094 Share on other sites More sharing options...
0 Amnesia Posted August 25, 2007 Author Share Posted August 25, 2007 works perfect :) Link to comment https://www.neowin.net/forum/topic/583507-random-banner-rotating-script/#findComment-588804259 Share on other sites More sharing options...
Question
Amnesia
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