Php simple anti-Leech implementation is detailed in the code & lt ;? Php $ ADMIN [defaulturl] http://www.ite5e.com/404.htm#//the address of the chain steal back okaysitesarray (http://www.ite5e.com/,http://www.jb51.net); // White List $ ADMIN [url_1] ht php simple anti-Leech implementation put into the code details
-
- $ ADMIN [defaulturl] = "http://www.ite5e.com/404.htm"; // address returned by leeching
- $ Okaysites = array ("http://www.ite5e.com/", "http://www.jb51.net"); // white list
- $ ADMIN [url_1] = "http://www.ite5e.com/temp/download/"; // download location 1
- $ ADMIN [url_2] = ""; // download location 2, and so on
- $ Ffer = $ HTTP_REFERER;
- If ($ ffer ){
- $ Yes = 0;
- While (list ($ domain, $ subarray) = each ($ okaysites )){
- If (ereg ($ subarray, "$ ffer ")){
- $ Yes = 1;
- }
- }
- $ Theu = "url". "_". "$ site ";
- If ($ ADMIN [$ theu] AND $ yes = 1 ){
- Header ("Location: $ ADMIN [$ theu]/$ file ");
- } Else {
- Header ("Location: $ ADMIN [defaurl URL]");
- }
- } Else {
- Header ("Location: $ ADMIN [defaurl URL]");
- }
- ?>
After testing on this site, it is a very simple and good method.