用PHP写一个每次访问网站按顺序跳转到指定网址使用cookie功能
= count($urls)){
$url_index = 0;
}
// 跳转到指定网址
header('Location: '.$urls[$url_index]);
// 更新cookie中的网址索引
setcookie('url_index', $url_index+1, time()+3600);
} else {
// 如果没有设置cookie,跳转到第一个网址
header('Location: '.$urls[0]);
// 设置cookie中的网址索引为1,因为已经访问了第一个网址
setcookie('url_index', 1, time()+3600);
}
?
原文地址: http://www.cveoy.top/t/topic/f4l5 著作权归作者所有。请勿转载和采集!