Hi!请登陆

如何将go跳转页面改为类似QQ邮箱跳转页面?

2021-1-15 56 1/15

GO 跳转页面其实大多数都相似,做法也比较简单,今天就以张戈博主分享的 GO 跳转页面为例进行说明如何改为类似 QQ 邮箱跳转页面。

1、首先你可以参照『分享张戈博主改善优化后的网站外链跳转页面代码』文章先成功折腾好 GO 跳转功能及相应页面。

2、将 GO 跳转页面的 HTML 代码(PHP 版本为例进行说明)改为类似 QQ 邮箱的跳转页面代码,比如将以下代码:

<?php
if(strlen($_SERVER['REQUEST_URI']) > 255 ||
strpos($_SERVER['REQUEST_URI'], "eval(") ||
strpos($_SERVER['REQUEST_URI'], "base64")) {
@header("HTTP/1.1 414 Request-URI Too Long");
@header("Status: 414 Request-URI Too Long");
@header("Connection: Close");
@exit;
}
//通过 QUERY_STRING 取得完整的传入数据,然后取得 url=之后的所有值,兼容性更好
$t_url = preg_replace('/^url=(.*)$/i','$1',$_SERVER["QUERY_STRING"]);
//此处可以自定义一些特别的外链,不需要可以删除以下 5 行
if($t_url=="zhangge" ) {
$t_url="https://zhang.ge";
} elseif($t_url=="baidu") {
$t_url="https://www.baidu.com/";
}
//数据处理
if(!empty($t_url)) {
//判断取值是否加密
if ($t_url == base64_encode(base64_decode($t_url))) {
$t_url = base64_decode($t_url);
}
//对取值进行网址校验和判断
preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i',$t_url,$matches);
if($matches){
$url=$t_url;
$title='页面加载中,请稍候...';
} else {
preg_match('/\./i',$t_url,$matche);
if($matche){
$url='http://'.$t_url;
$title='页面加载中,请稍候...';
} else {
$url = 'http://'.$_SERVER['HTTP_HOST'];
$title='参数错误,正在返回首页...';
}
}
} else {
$title = '参数缺失,正在返回首页...';
$url = 'http://'.$_SERVER['HTTP_HOST'];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow" />
<noscript><meta http-equiv="refresh" content="1;url='<?php%20echo%20$url;?>';"></noscript>
<script>
function link_jump()
{
//禁止其他网站使用我们的跳转页面
var MyHOST = new RegExp("<?php echo $_SERVER['HTTP_HOST']; ?>");
if (!MyHOST.test(document.referrer)) {
location.href="http://" + MyHOST;
}
location.href="<?php%20echo%20$url;?>";
}
//延时 1S 跳转,可自行修改延时时间
setTimeout(link_jump, 1000);
//延时 50S 关闭跳转页面,用于文件下载后不会关闭跳转页的问题
setTimeout(function(){window.opener=null;window.close();}, 50000);
</script>
<title><?php echo $title;?></title>
<style type="text/css">
body{background:#555}.loading{-webkit-animation:fadein 2s;-moz-animation:fadein 2s;-o-animation:fadein 2s;animation:fadein 2s}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-o-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}.spinner-wrapper{position:absolute;top:0;left:0;z-index:300;height:100%;min-width:100%;min-height:100%;background:rgba(255,255,255,0.93)}.spinner-text{position:absolute;top:45%;left:50%;margin-left:-100px;margin-top:2px;color:#000;letter-spacing:1px;font-size:20px;font-family:Arial}.spinner{position:absolute;top:45%;left:50%;display:block;margin-left:-160px;width:1px;height:1px;border:20px solid rgba(255,0,0,1);-webkit-border-radius:50px;-moz-border-radius:50px;border-radius:50px;border-left-color:transparent;border-right-color:transparent;-webkit-animation:spin 1.5s infinite;-moz-animation:spin 1.5s infinite;animation:spin 1.5s infinite}@-webkit-keyframes spin{0%,100%{-webkit-transform:rotate(0deg) scale(1)}50%{-webkit-transform:rotate(720deg) scale(0.6)}}@-moz-keyframes spin{0%,100%{-moz-transform:rotate(0deg) scale(1)}50%{-moz-transform:rotate(720deg) scale(0.6)}}@-o-keyframes spin{0%,100%{-o-transform:rotate(0deg) scale(1)}50%{-o-transform:rotate(720deg) scale(0.6)}}@keyframes spin{0%,100%{transform:rotate(0deg) scale(1)}50%{transform:rotate(720deg) scale(0.6)}}
</style>
</head>
<body>
<div class="loading">
<div class="spinner-wrapper">
<span class="spinner-text">页面加载中,请稍候...</span>
<span class="spinner"></span>
</div>
</div>
</body>
</html>

修改为

<?php
if(strlen($_SERVER['REQUEST_URI']) > 255 ||
strpos($_SERVER['REQUEST_URI'], "eval(") ||
strpos($_SERVER['REQUEST_URI'], "base64")) {
@header("HTTP/1.1 414 Request-URI Too Long");
@header("Status: 414 Request-URI Too Long");
@header("Connection: Close");
@exit;
}
//通过 QUERY_STRING 取得完整的传入数据,然后取得 url=之后的所有值,兼容性更好
$t_url = preg_replace('/^url=(.*)$/i','$1',$_SERVER["QUERY_STRING"]);
//此处可以自定义一些特别的外链,不需要可以删除以下 5 行
if($t_url=="zhangge" ) {
$t_url="https://zhang.ge";
} elseif($t_url=="baidu") {
$t_url="https://www.baidu.com/";
}
//数据处理
if(!empty($t_url)) {
//判断取值是否加密
if ($t_url == base64_encode(base64_decode($t_url))) {
$t_url = base64_decode($t_url);
}
//对取值进行网址校验和判断
preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i',$t_url,$matches);
if($matches){
$url=$t_url;
$title='页面加载中,请稍候...';
} else {
preg_match('/\./i',$t_url,$matche);
if($matche){
$url='http://'.$t_url;
$title='页面加载中,请稍候...';
} else {
$url = 'http://'.$_SERVER['HTTP_HOST'];
$title='参数错误,正在返回首页...';
}
}
} else {
$title = '参数缺失,正在返回首页...';
$url = 'http://'.$_SERVER['HTTP_HOST'];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="robots" content="noindex, nofollow" />
<noscript><meta http-equiv="refresh" content="1;url='<?php%20echo%20$url;?>';"></noscript>
<script>
function link_jump()
{
//禁止其他网站使用我们的跳转页面
var MyHOST = new RegExp("<?php echo $_SERVER['HTTP_HOST']; ?>");
if (!MyHOST.test(document.referrer)) {
location.href="http://" + MyHOST;
}
}
//延时 1S 跳转,可自行修改延时时间
setTimeout(link_jump, 1000);
//延时 50S 关闭跳转页面,用于文件下载后不会关闭跳转页的问题
setTimeout(function(){window.opener=null;window.close();}, 50000);
</script>
<title><?php echo $title;?></title>
<style>body{margin:0;padding:0 30px;background:#fff;font-size:12px}img{border:none}a{text-decoration:none;cursor:pointer;outline:0}a:hover{text-decoration:underline}a,a:link,a:visited{color:#1e5494}a.btn_blue:focus{border-color:#93d4fc;box-shadow:0 0 5px #60caff}a.btn_blue{display:inline-block;padding:6px 25px;margin:0;font-size:14px;font-weight:700;text-align:center;border-radius:3px;border:1px solid #0d659b;color:#fff;color:#fff!important;background-color:#238aca;background:-moz-linear-gradient(top,#238aca,#0074bc);background:-webkit-linear-gradient(top,#238aca,#0074bc);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#238aca', endColorstr='#0074bc');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr='#238aca', endColorstr='#0074bc')"}a.btn_blue:hover{text-decoration:none;background-color:#238aca;background:-moz-linear-gradient(top,#2a96d8,#0169a9);background:-webkit-linear-gradient(top,#2a96d8,#0169a9);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a96d8', endColorstr='#0169a9');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a96d8', endColorstr='#0169a9')"}a.btn_blue:active{background-color:#238aca;background:-moz-linear-gradient(top,#0074bc,#238aca);background:-webkit-linear-gradient(top,#0074bc,#238aca);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0074bc', endColorstr='#238aca');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr='#0074bc', endColorstr='#238aca')";outline:0}.remind_block{overflow:hidden}.remind_block .remind_content{overflow:hidden}.remind_block .remind_title{margin-bottom:10px;padding-top:3px;font-weight:700;font-size:20px;font-family:"Microsoft YaHei","lucida Grande",Verdana}.remind_block .remind_detail{line-height:1.5;font-size:16px;color:#535353}.warning .remind_title{color:#16a085}.container{max-width:640px;margin:0 auto;padding-top:25px}.header{margin-bottom:5px}.footer{margin-top:18px;text-align:center;color:#a0a0a0;font-size:10px}.content{border:1px solid #bbb;box-shadow:0 0 3px #d4d4d4}.c-container{padding:30px}.c-footer{padding:10px 15px;background:#f1f1f1;border-top:1px solid #bbb;overflow:hidden}.c-footer-a1,.c-footer-a2{float:left}.c-footer-a2{margin:8px 0 0 15px}.safety-url{margin-bottom:15px;padding-bottom:15px;border-bottom:1px solid #dfdfdf;word-wrap:break-word;word-break:break-all}</style>
</head>
<body>
<div class="container">
<div class="header">
<img width="150" height="35" src="logo%20图片地址">
</div>
<div class="content">
<div class="c-container warning">
<div id="remind_block" class="remind_block" style="height: 260px;">
<div class="remind_content">
<div class="remind_title">
您将要访问
</div>
<div class="remind_detail">
<div class="safety-url">
<?php%20echo%20$url;?>
</div>
<span style="color:#CC0000;font-weight:800;">温馨提示:</span><br/>该网页不属于 OZABC 导航,我们无法确认该网页是否安全,它可能包含未知的安全隐患,请注意保护好个人信息!
</div>
</div>
</div>
</div>
</div>
<div class="c-footer">
<a href="<?php%20echo%20$url;?>" rel="nofollow" class="c-footer-a1 btn_blue">继续访问</a><a class="c-footer-a2" href="https://OZABC.com/" rel="nofollow">返回主页</a>
</div>
</div>
<div class="footer">Copyright © OZABC 导航</div>
</body>
</html>

即可。

注意:

1、记得将以上代码的 logo%20图片地址、返回主页地址和版权说明的 OZABC 导航更改为自己站点的即可。

2、其实只需要修改 GO 跳转页面中的 HTML 代码即可。由于关闭网页在移动端的浏览器不太兼容,所以就把关闭网页改为返回主页。

3、个人认为这个 GO 跳转页面不单单适用于 WordPress 站点,应该也是适用于 ZBlog 站点的,所以有需要的博主站长可以自行参考折腾试试。

相关推荐