Hi,
In this php tutorial you will learn how to build a random image banner rotator. Basically, it’s the same as the link rotator, we build a php array with images wanted to rotate, then we’ll apply the rand() php function.
<?php $banners = array("path/img1.jpg", "path/img2.gif"); $max = sizeof($banners); $rand = rand(0, $max); print $banners[$rand]; ?>
Hi,
This is great blog and has answered many of my questions. Just one other question with this php script.
I have an affiliate website to do with mobile phone deals and so on. I have dedicated a small section for banners but I want to rotate the banners I have like this code does, but this code does not allow for the link in the banner.
How can this script be modified such that I can use banners from affiliate programs?
Asim
Thanks for this wonderful script, i am going to use this in my forum. is it will work in my forum.
You guys start thinking I just give guidelines and start scripts, adapt it for your own needs or rent my php services to do it for you! No freebies!