用PHP加一个功能网站访问加载前随机获取数据库表jiuai_host中的域名并跳转到这个域名保留后缀参数htmlmeta content=width=device-width initial-scale=10 maximum-scale=10 user-scalable=0 name=viewport title旧爱防红titlescript type=textjavascript var ti
<?php
// 获取数据库中的所有域名
$sql = "SELECT `domain` FROM `jiuai_host`";
$res = mysqli_query($conn, $sql);
$domains = [];
while ($row = mysqli_fetch_assoc($res)) {
$domains[] = $row['domain'];
}
// 随机获取一个域名
$rand_key = array_rand($domains);
$rand_domain = $domains[$rand_key];
// 生成完整链接
$t_url = "http://" . $rand_domain . $_SERVER['REQUEST_URI'];
?>
<html>
<head>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<title>旧爱防红</title>
<script type="text/javascript">
var time = 10; // 设置倒计时时间
var timer = setInterval("countDown()", 1000); // 设置定时器
<pre><code>function countDown() {
if (time == 0) {
clearInterval(timer); // 清除定时器
document.getElementById("notice").style.display = "none"; // 隐藏公告信息
}
else {
document.getElementById("countdown").innerHTML = time; // 显示倒计时时间
time--; // 时间减1秒
}
}
</code></pre>
</script>
<style type="text/css">
#notice {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #f00;
color: #fff;
padding: 20px;
font-size: 24px;
text-align: center;
border-radius: 10px;
z-index: 9999;
}
</style>
</head>
<body>
<div id="notice">
<p>网站<?php echo $conf['jiuai4']; ?></p>
<p>广告将在 <span id="countdown">10</span> 秒后自动消失</p>
</div>
<!-- 网站内容 -->
</body>
<body style="margin:0;padding:0;height:100%" scroll=no>
<iframe id="infrm" name="infrm" marginwidth="0" marginheight="0" width="100%" scrolling=auto src="<?php echo $t_url ?>" frameborder="0" height="100%"allowfullscreen="true"></iframe>
<script>
$("#Zl").html("<iframe id='infrm' name='infrm' marginwidth='0' marginheight='0' width='100%' scrolling='auto' src='<?php echo $t_url ?>' frameborder='0' height='100%'allowfullscreen='true'></iframe>");
$(document).ready(function(){
function fix_height(){ $("#infrm").attr("height", (($(window).height())-5) + "px");}
$(window).resize(function(){ fix_height(); }).resize();
$("#infrm").contentWindow.focus();
});
</script>
<script>
var iframe = document.getElementById("infrm");
if (iframe.attachEvent){ // 兼容IE写法
iframe.attachEvent("onload", function(){
// iframe加载完成后要进行的操作
document.title="<?php echo $title ?>";
top.document.getElementById("paneloading").style.display = "none";
top.document.getElementById("Zl").style.display = "";
// alert("加载完成");
})
} else {
iframe.onload = function(){
// iframe加载完成后要进行的操作
document.title="<?php echo $title ?>";
top.document.getElementById("paneloading").style.display = "none";
top.document.getElementById("Zl").style.display = "";
// alert("加载完成");
}
}
</script>
</html>
原文地址: https://www.cveoy.top/t/topic/bC6F 著作权归作者所有。请勿转载和采集!