PHP Simple anti-theft chain implementation method, PHP anti-theft implementation
This paper describes the simple anti-theft chain implementation method of PHP. Share to everyone for your reference. Specific as follows:
<?php$admin = Array ( ' defaulturl ' = ' http://blog.qita.in/images/banner-header.gif ', //hotlinking return address ' Url_1 ' = ' http://blog.qita.in/file ', ' url_2 ' = ' http://blog.qita.in/file1 ', '; $okaysites = Array (' http://qita.in ', ' http://blog.qita.in ',//White list ' http://blog.qita.in/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 ');? >
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1039197.html www.bkjia.com true http://www.bkjia.com/PHPjc/1039197.html techarticle PHP Simple anti-theft chain implementation method, PHP anti-theft implementation of this article describes the PHP simple anti-theft chain implementation method. Share to everyone for your reference. as follows: Php$admin = Array (' Defaultu ...