该脚本有效,它加载到我的图像中。
我希望它在 10 秒后加载新图像,当我尝试这个时,它对我做错了什么没有任何建议?
<?php header("Refresh: 5; URL=mytestfile.php"); ?>
<div style="width: 964px;">
<div style="float: left; width: 240px;">
<?php $mybanners[1] = '<a href="/chiropractor/"><img src="banners/chiropractor.jpg"></a>';
$mybanners[2] = '<a href="/chiropodist/"><img src="banners/chiropody.jpg"></a>';
$mybanners[3] = '<a href="/fitness-instructor/"><img src="banners/fitness ball.jpg"></a>';
$mybanners[4] = '<a href="/dietician/"><img src="banners/Dietician.jpg"></a>';
$mybanners[5] = '<a href="/alexander-technique/"><img src="banners/Alexander technique.jpg"></a>';
$id = rand(1,5);
echo $mybanners[$id];
// this is the section I tried to control the delay
$mybanners = 0;
for($i=0; $i<10000; $i++){
if($i=='10000'){
$mybanners++;
$i = 0;
}
if($mybanners=='10'){
$mybanners=0;
}
}?>