PHP仿盗链 PHP仿盗链代码

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

PHP仿盗链 PHP仿盗链代码

  2021-03-19 我要评论
想了解PHP仿盗链代码的相关内容吗,在本文为您仔细讲解PHP仿盗链的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:PHP仿盗链,下面大家一起来学习吧。
复制代码 代码如下:

<?php
/**
* @author seraphim
* @copyright 2012
*/
$ADMIN = array(
'defaulturl'=> 'http://www.xx.com/images/banner-header.gif', //盗链返回的地址
'url_1' => 'http://www.xx.net/file',
'url_2' => 'http://www.xx.net/file1',
);
$okaysites = array(
'http://box.baidu.com',
'http://tieba.baidu.com/p/1493336008', //白名单
'http://www.xx.com/1.html',
);
$reffer = $_SERVER['HTTP_REFERER'];
if ($reffer) {
$yes = 0;
while (list($domain, $subarray) = each($okaysites)) {
if (ereg($subarray, "$reffer")) {
$yes = 1;
}
}
$theu = 'url_' . $_GET['site'];
$file = $_GET['file'];
if ($ADMIN[$theu] and $yes == 1) {
header("Location: $ADMIN[$theu]/$file");
} else {
header("Location: $ADMIN[defaulturl]");
}
} else {
header("Location: $ADMIN[defaulturl]");
}
print_r($_SERVER['HTTP_REFERER']);
?>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们