PDA

View Full Version : Random Banner Script



SlicedCheese
22-10-2005, 10:22 AM
Heres a really simple script that you can use to create a Random Banner, it's php so you will need a host that supports php. You can get javascript ones of these, but this isnt as short.


<?php
$banner[1]="banner1url.png";
$banner[2]="banner2url.png";
$banner[3]="banner3url.png";
$random = rand(1, count($banner);
?>
My brother posted this on HabboForum for me as i am banned but im not banned on this so i will post it personally.

Then place this whereever you want the banners

<img src="<?php echo $banner[$random]; ?>">

Sygon
22-10-2005, 10:27 AM
Wow, thanks nice + rep

Mentor
22-10-2005, 02:21 PM
"/ Thats been posted here quite few times now, plus the javascript one, well if u use a decent one, will be roughly the same lengh exspet base code will sit with the image is to go "/

Also note with that script just ad more $banner[NUM] = "IMAGE URL"; varibles to the list, to ad more to the randomizer, keep in mind the NUM must count up, and that it can use any image media type.

Want to hide these adverts? Register an account for free!