0

My banner rotating script dispalys first image only.

script is like:

<?php
$bannerCounter = 1;
$bannerCode[$bannerCounter] = "<a href=\"http://www.kganyang.co.za\"/scanners.php target=\"_top\"> <img src=\"images/adverts/maq10.jpg\" width=\"90\" height=\"83\" alt=\"Buy a Scanner!\" border=\"0\"></a>";
$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href=\"http://www.kganyang.co.za\"/scanners.php target=\"_top\"> <img src=\"images/adverts/maq2.jpg\" width=\"90\" height=\"83\" alt=\"Buy a Scanner!\" border=\"0\"></a>";
$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href=\"http://www.kganyang.co.za\"/scanners.php target=\"_top\"> <img src=\"images/adverts/maq3.jpg\" width=\"90\" height=\"83\" alt=\"Buy a scanner\" border=\"0\"></a>";
$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href=\"http://www.kganyang.co.za\"/scanners.php target=\"_top\"> <img src=\"images/adverts/maq4.jpg\" width=\"88\" height=\"88\" alt=\"Buy a scanner!\" border=\"0\"></a>";
$bannerCounter++;

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

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by liamfriel
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.