FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Simple PHP Banner Rotator

 


robo_rat
A simple Banner rotator to randomly select a banner.

Code:
echo "<img alt='Random Banner' src='images/banner".rand(1, #).".jpg' border='1'>"


All you need to do is upload banners to the /images folder and name each one banner#.jpg. Modify the random number (#) to match the largest number on the banner file.
netpro
robo_rat wrote:
A simple Banner rotator to randomly select a banner.

Code:
echo "<img alt='Random Banner' src='images/banner".rand(1, #).".jpg' border='1'>"


All you need to do is upload banners to the /images folder and name each one banner#.jpg. Modify the random number (#) to match the largest number on the banner file.


how if file name is not banner#.jpg ??
example : mybanner.jpg, mypic.jpg, etc.
so I can make 'alt' same with file name each.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.