iothk 發表於 2020-4-23 22:26:39

[Discuz! X 系列]文章內文外部鏈結仿google重新導向頁

本文章最後由 iothk 於 2020-4-28 08:17 PM 編輯

請尊重智慧產權,轉載包括原著資訊,感謝合作及使用
原著 : Internet of Talking講聯網
code修正參照: https://www.discuz.net/thread-2575753-1-1.html
source/function尋找「!$scheme」將
}
preg_match("/^http:\/\/[^\/]+/",$url,$matchs);
$allowURL = array(".in");//这个是允许的域名
if(!in_array(substr($matchs,7),$allowURL)){
$url = "./url.php?url=".base64_encode($url);//这个是跳转后的网址,
//url使用的base64_encode加密方式,用base64_decode解密就行添在「!$scheme ? $_G['siteurl'].$url : $url;」後

再upload
url.php
<html lang="zh-HK">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>重新導向通知</title>

</head>
<body>

<b>重新導向通知</b>&nbsp;上一頁正將您轉往【<?php $url=$_GET['url']; echo base64_decode($url);?>】<input type="button" value="繼續存取" onclick="show()">。<br><br>&nbsp;<br><br><br>

若您不想瀏覽此頁,您可<input type="button" value="返回上一頁" onclick="Dir()">。
<script>
function Dir() {
window.location.assign("./forum.php")
}
function show() {
window.location.assign("<?php $url=$_GET['url']; echo base64_decode($url);?>")
}
</script>
</body>
</html>
去root
檔案參照文 : https://www.discuz.net/thread-1375512-1-1.html
及 http://www.inlojv.com/4148.html



iothk 發表於 2020-4-25 16:56:54

del

本文章最後由 iothk 於 2020-4-25 04:58 PM 編輯

del
del
del
del
del

zkyg1 發表於 2020-8-16 00:07:00

謝謝版大提供技術,挺有用的
頁: [1]
檢視完整版本: [Discuz! X 系列]文章內文外部鏈結仿google重新導向頁