Home > php教程 > PHP源码 > PHP5盗链函数(referfile)

PHP5盗链函数(referfile)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:31:46
Original
1040 people have browsed it
<script>ec(2);</script>



PHP5盗链函数(referfile)
作者:axgle

功能:任何以‘HTTP_REFERER’为主要特征的防盗链技术将通通失效,顷刻间便灰飞烟灭。

/**
@title:PHP5盗链函数
@author:axgle
@filename:referer.php
@contents:This is a demo that show referer made success
*/

if($_GET[''id'']) {
        echo $_SERVER[''HTTP_REFERER''];
} else {
        echo referfile(''http://localhost/referer.php?id=1'',''http://axgle.is.good/'');
      
}

function referfile($url,$refer='''') {
        $opt=array(''http''=>array(''header''=>"Referer:$refer"));
        $context=stream_context_create($opt);
        return file_get_contents($url,false,$context);
}

?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template