• 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.
  • Posts

    • I don't get why you care how thin your phone is. Most people slap a giant case on it anyway, so it doesn't mean much in the long run.
    • Yay it finally made it to openSUSE Tumbleweed. Installed on the rest of my PCs/laptops and also working just fine. Was also available before for KDE Neon and Fedora. And I hear Arch also already has it.
    • Yeah basically family safety is tied to your sons acc and your be the manager of it right and can see what they view and can control it. However open edge and you can actually signin to another account while on the windows account you are monitoring and bypass the restrictions. It was different to this on Windows 7 all the stuff was local not in cloud, so didn't matter if you signed out the browser. Chrome can usually still be installed even when blocked, my son used to use other acc in browser and download chrome and then use that freely and install apps and stuff as webapps. None of the tracking stuff would work. I originally ended up blocking downloads via group policy, microsoft store, winget, and loads of other stuff via group policy. But yeah as i said he just got to the point he reset the pc. I stopped that with bios password but he yanked the cmos battery (restores bios and removes password) and reinstalled windows. Other than physically locking the case away and watching him like a hawk its gameover now. It was kinda self inflicted, i did teach my son some cybersecurity stuff and i used to encourage him to try get past my blocking (so he learnt some skills for the future), he can actually lockpick interesting how you bring that up lol (another thing i got him into) I agree with the parenting thing locking stuff down is not the only solution.
    • PC gaming market is being killed by the high prices of GPU's and all these smaller LLM's that people are playing with are causing it. That and greed. AMD is still way behind NVIDIA. The number of games that still does not support FRS3 is bad, FRS4 is a even worse, and on the flip side you have to look far and wide to find a game that does not support DLSS (newer games). Then there is power consumption which AMD always lags behind in.
  • Recent Achievements

    • Week One Done
      Helen Shafer earned a badge
      Week One Done
    • First Post
      emptyother earned a badge
      First Post
    • Week One Done
      Crunchy6 earned a badge
      Week One Done
    • One Month Later
      KynanSEIT earned a badge
      One Month Later
    • One Month Later
      gowtham07 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      659
    2. 2
      ATLien_0
      268
    3. 3
      Michael Scrip
      222
    4. 4
      Steven P.
      167
    5. 5
      +FloatingFatMan
      163
  • Tell a friend

    Love Neowin? Tell a friend!