View Single Post
Old 06-16-2005, 09:48 AM  
viki
Confirmed User
 
viki's Avatar
 
Join Date: Jan 2005
Posts: 2,640
Here's a PHP solution that I use:

Put this in a separate file, add as many links as you'd like... and of course remember to escape all quotation marks within the link with a \.

PHP Code:
<? 
$bannerCounter= 1; 

$bannerCode[$bannerCounter] = "<a href=\"http://www.yoursite.com\">text link or image here</a>"; 
$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href=\"http://www.yoursite.com\">text link or image here</a>"; 
$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href=\"http://www.yoursite.com\">text link or image here</a>"; 
$bannerCounter++;



$bannerAdTotals = $bannerCounter - 1; 
if($bannerAdTotals>1) 
{
   mt_srand((double)microtime() * 1234567); 
   $bannerPicked = mt_rand(1, $bannerAdTotals); 
}
else
{
   $bannerPicked = 1; 
}
$bannerAd = $bannerCode[$bannerPicked]; 
?>

And then put this code where you want to see the rotation. Where it says "links.php" , rename that to whatever you named the previous file.

PHP Code:
<? 
include_once("links.php"); 
echo "<div align='center'>$bannerAd</div>";
?>
__________________

viki [at] realsexcash [dot] com
228 263 454
viki is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote