找回密码
 注册账户
查看: 1767|回复: 2

Simple Banner Rotator 广告轮显

[复制链接]
admin 发表于 2008-1-3 02:43:45 | 显示全部楼层 |阅读模式
$links = array(
"http://www.google.com",
"http://www.msn.com",
"http://forums.digitalpoint.com"
);
//add a new link for the banner to a new line in the same format as above

$images = array(
"http://www.google.co.uk/intl/en_uk/images/logo.gif",
"http://stc.msn.com/br/hp/en-us/css/35/decoration/msn_b.gif",
"http://forums.digitalpoint.com/images/misc/dps_logo.gif"
);
//add a new image link for the banner to a new line in the same format as above

<?php
session_start();

$links = array(
"http://www.google.com",
"http://www.msn.com",
"http://forums.digitalpoint.com"
);
//add a new link for the banner to a new line in the same format as above

$images = array(
"http://www.google.co.uk/intl/en_uk/images/logo.gif",
"http://stc.msn.com/br/hp/en-us/css/35/decoration/msn_b.gif",
"http://forums.digitalpoint.com/images/misc/dps_logo.gif"
);
//add a new image link for the banner to a new line in the same format as above
//——– DO NOT EDIT BELOW THIS LINE———-
$count = count($links) -1;

$randnum = mt_rand(0,$count);

if      ($randnum == $_SESSION[‘randnum’])
        {
        $randnum = mt_rand(0,$count);
        }
$_SESSION[‘randnum’] = $randnum;
echo ‘<a href="’.$links[$randnum].‘"><img style=" border:none" src="’.$images[$randnum].‘" /></a>

‘;

?>
onions 发表于 2008-2-22 20:59:21 | 显示全部楼层
谢谢大大的分享了哈。。这个是个好东西哈
onions 发表于 2008-2-22 21:01:03 | 显示全部楼层
谢谢大大的分享了哈。。这个是个好东西哈
您需要登录后才可以回帖 登录 | 注册账户

本版积分规则

存档|黑屋|手机|网络实验室 本站服务器由美国合租以及IDCLayer国际数据提供!!!

GMT+8, 2026-6-4 20:39 , Processed in 0.014878 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表