This article mainly introduces the PHP simple anti-theft chain implementation method, involving PHP for the server-side pre-defined variable invocation and string processing of the relevant skills, with a certain reference value, the need for friends can refer to the next
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 ');? >
Summary : The above is the entire content of this article, I hope to be able to help you learn.
Related recommendations:
PHP Three recursive function implementation method
The function of using curl to forge IP in PHP
PHP Simulation method of response class in ASP