Does anybody know of a script that will rotate links? For example, user 1 clicks on a link and takes them to tour A. user 2 clicks the link and takes them to tour B.
Thanks for any and all help.
Thanks for any and all help.
<!----Main Banner Rotation--------
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) hahahaha 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else {
if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else {
if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
}
}
var winl = (myWidth - 624) / 2;
var wint = (myHeight - 600) / 2;
n=new Date();
//j=n.getSeconds();
m=n.getMilliseconds();
t=n.getSeconds();
b=m*.001;
j=t+b;
if (j<20.3) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else if (j<40.1) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else if (j<59.9) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else document.write("<center><a href=\"http://www.defaultlink.com\" target=\"_blank\"><img src=\"http://yoursite.com/big.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
//----Banner Rotation-----End Hide from inferior browsers----->
<!----Main Banner Rotation--------
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) hahahaha 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else {
if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else {
if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
}
}
var winl = (myWidth - 624) / 2;
var wint = (myHeight - 600) / 2;
n=new Date();
//j=n.getSeconds();
m=n.getMilliseconds();
t=n.getSeconds();
b=m*.001;
j=t+b;
if (j<20.3) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else if (j<40.1) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else if (j<59.9) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else document.write("<center><a href=\"http://www.defaultlink.com\" target=\"_blank\"><img src=\"http://yoursite.com/big.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
//----Banner Rotation-----End Hide from inferior browsers----->
<?
$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];
?><?
include_once("links.php");
echo "<div align='center'>$bannerAd</div>";
?>
Comment