PHP Button Rotation
| Rate this tutorial: |
|
Button rotations are used when a website advertises another. Everytime the page is refreshed or you click to another page, a new button appears. I recommend using this PHP Button Rotation because not everyone has Java Scripts turned on. If they don’t, they won’t be able to view the buttons properly. This is what it looks like:
<?php
$img = array();
$img[] = '<a href="URL"><img src="BUTTON URL" alt="" border="0" /></a>';
$img[] = '<a href="URL"><img src="BUTTON URL" alt="" border="0" /></a>';
$img[] = '<a href="URL"><img src="BUTTON URL" alt="" border="0" /></a>';
$img[] = '<a href="URL"><img src="BUTTON URL" alt="" border="0" /></a>';
$max = count($img) - 1;
$count = rand(0,$max);
echo $img[$count];
?>
It’s pretty basic. Simply add the websites URL where it says “URL” and their button URL where it says “BUTTON URL”. If you want to advertise more than 4 websites at a time, simply add more of the following:
$img[] = '<a href="URL"><img src="BUTTON URL" alt="" border="0" /></a>';