Thread: RANDOM script
View Single Post
Old 2003-09-07, 05:47 PM   #7
natalie
Whoo! 9/10 the way to buddy plays in "The Christ from Oz"!
 
natalie's Avatar
 
Join Date: Aug 2003
Location: Australia
Posts: 921
Send a message via ICQ to natalie
Heres a quick one i did last week, its hard coded (naughty ) and doesnt use a db but my host is a pain with not letting me do the db myself atm. But it does a random from the case, which you could adapt to use with a db. I use the variables to change the alt tag, img etc on a group of banners. Like i said it was just a quick fix.

<?php
$random = rand(0, 4);
switch ($random)
{
case 1:
$href="http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=924527-0000&PA=00000";
$imgsrc="images/rotators/460x801.jpg";
$alt="fantastic erotic ezine for women";
$mouseover="http://www.forthegirls.com/";
break;

case 2:
$href="http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=924527-0000&PA=00000";
$imgsrc="images/rotators/460x802.jpg";
$alt="fantastic erotic ezine for women";
$mouseover="http://www.forthegirls.com/";
break;

case 3: $href="http://stats.clearcard.com/servlet/Click?dec2000";
$imgsrc="images/rotators/csban2.jpg";
$alt="Couples Sex Adult Club - Foreplay On the Internet";
$mouseover="http://www.couplessex.com/";
break;

case 4: $href="http://stats.clearcard.com/servlet/Click?dec2000";
$imgsrc="images/rotators/banner1c.jpg";
$alt="Couples Sex Adult Club - Foreplay On the Internet";
$mouseover="http://www.couplessex.com/";
break;

default:
$href="http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=924527-0000&PA=499687";
$imgsrc="images/rotators/460x801.jpg";
$alt="fantastic erotic ezine for women";
$mouseover="http://www.forthegirls.com/";
break;

}
?>


And put this where you need the variables: <? echo $imgsrc; ?>
natalie is offline   Reply With Quote