This is a small and handy tutorial that explains an easy way to setup some banners to display in rotation on your website. There are no special requirements, the only thing that is needed is PHP enabled on the server (All servers got this by default)
Put this code at the top of your file where you want the banner rotation to be displayed (eg: index.php)
<?php
$banner = array();
$banner[] = ‘<a href=”http://www.website1.com“><img src=”images/banner1.gif” alt=”Website1″ /></a>’;
$banner[] = ‘<a href=”http://www.warezteacher.com“><img src=”images/banner2.gif” alt=”Warezteacher” /></a>’;
shuffle($banners);
?>
Then in the same file where you want to display the banners in rotation you put the following code:
<?php
echo $banner[0];
?>
HINT:
*Make sure the file is saved as *.php
*Make sure you put the correct path to the image.
Enjoy!
Leave a Reply
You must be logged in to post a comment.
Recent Comments