Home › Forums › Back End › How Do They Do It? (Banner Rotation) › Re: How Do They Do It? (Banner Rotation)
August 10, 2009 at 1:40 pm
#61965
TheDoc
Member
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:
http://php.about.com/od/finishedphp1/qt … banner.htm
Essentially, it’ll be something like this:
<?php
$num = rand(1, 5);
?>
<img class="classname" alt="" src="images/banner-<?php echo $num; ?>.jpg" />