The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How Do They Do It? (Banner Rotation) Re: How Do They Do It? (Banner Rotation)


I’m a huge fan of PHP for this. So much so that I’m moving this topic to the PHP section!

You can simply use the rand() function to achieve the results. Here’s a really simple explanation: … banner.htm

Essentially, it’ll be something like this:

$num = rand(1, 5);

<img class="classname" alt="" src="images/banner-<?php echo $num; ?>.jpg" />