This article mainly introduces the php simple anti-leech implementation method, which involves php's skills related to server-side predefined variable calls and string processing. It has some reference value. If you need it, you can refer
This article mainly introduces the php simple anti-leech implementation method, which involves php's skills related to server-side predefined variable calls and string processing. It has some reference value. If you need it, you can refer
This article describes how to implement simple anti-leech protection in php. Share it with you for your reference. The details are as follows:
<? Php $ ADMIN = array ('defaulturl' => 'HTTP: // blog. qita. in/images/banner-header.gif ', // address returned by leeching 'url _ 1' => 'HTTP: // blog. qita. in/file', 'url _ 2' => 'HTTP: // blog. qita. in/file1',); $ okaysites = array ('HTTP: // qita. in ', 'HTTP: // blog. qita. in ', // whitelist '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 will help you with php programming.
,