随机跳转域名
$domains = explode(',', '213.qq.whsc.gay');
$chosen_domain = $domains[array_rand($domains)]; // 随机获取$j46里的一个值
if (!isset($_COOKIE['redirected']) && strpos($_SERVER['HTTP_HOST'], 'url.whsc.gay') === false) {
setcookie('redirected', 'true', time()+10);
$current_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$new_url = 'http://' . $chosen_domain . $_SERVER['REQUEST_URI'];
header('Refresh: 3; URL=' . $new_url);
echo '<title>跳转中,请稍等 </title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<style>
* {
margin: 0;
padding: 0;
font-family: 'Microsoft YaHei';
color: #fff;
}
body,
div,
form,
input,
li,
ol,
p,
textarea,
ul {
margin: 0;
padding: 0;
font-family: 'Microsoft YaHei';
color: #fff;
}
body {
background: #fff;
color: #3f3f3f;
font-family: Apple LiGothic Medium, SimHei, Geneva, Arial, Helvetica, sans-serif;
-webkit-tap-highlight-color: transparent;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-appearance: none;
width: 100%;
font-size: 12px;
}
body p {
color: white;
text-align: center;
line-height: 25px;
}
.spinner {
margin: 100px auto 0;
width: 150px;
text-align: center;
}
.spinner > div {
width: 30px;
height: 30px;
background-color: #B0C4DE;
border-radius: 100%;
display: inline-block;
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
animation: bouncedelay 1.4s infinite ease-in-out;
/* Prevent first frame from flickering when animation starts */
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.spinner .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0.0)
}
40% {
-webkit-transform: scale(1.0)
}
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
}
40% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
</style>
<div id='paneloading' style='display:'>
<div class='spinner'>
<div class='bounce1'></div>
<div class='bounce2'></div>
<div class='bounce3'></div>
</div>
<body style='background: #FFFFFF;'></body>
</div>';
exit();
} else {
// 已经跳转过,不再跳转
}
在这个示例中,使用 strpos($_SERVER['HTTP_HOST'], 'url.whsc.gay') === false 来判断当前域名是否包含 'url.whsc.gay',如果不包含,则执行跳转代码。
这段代码使用 cookie 来避免重复跳转,并在跳转过程中显示一个简单的加载动画。
注意: 这种方式可能会被一些安全软件识别为恶意行为,请谨慎使用。
改进建议:
- 可以使用更安全的跳转方式,例如使用 JavaScript 或服务器端重定向。
- 可以使用更复杂的加载动画,以提升用户体验。
- 可以设置更合理的跳转时间间隔,以避免用户感到烦躁。
- 可以记录跳转数据,以便分析用户行为。
- 请确保跳转到的域名安全可靠,避免用户遭受安全风险。
希望以上内容对您有所帮助!如果您还有其他问题,请随时提问。
原文地址: https://www.cveoy.top/t/topic/bul1 著作权归作者所有。请勿转载和采集!