PHP simple anti-Leech implementation into code details

Source: Internet
Author: User
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

  1. $ ADMIN [defaulturl] = "http://www.ite5e.com/404.htm"; // address returned by leeching
  2. $ Okaysites = array ("http://www.ite5e.com/", "http://www.jb51.net"); // white list
  3. $ ADMIN [url_1] = "http://www.ite5e.com/temp/download/"; // download location 1
  4. $ ADMIN [url_2] = ""; // download location 2, and so on
  5. $ Ffer = $ HTTP_REFERER;
  6. If ($ ffer ){
  7. $ Yes = 0;
  8. While (list ($ domain, $ subarray) = each ($ okaysites )){
  9. If (ereg ($ subarray, "$ ffer ")){
  10. $ Yes = 1;
  11. }
  12. }
  13. $ Theu = "url". "_". "$ site ";
  14. If ($ ADMIN [$ theu] AND $ yes = 1 ){
  15. Header ("Location: $ ADMIN [$ theu]/$ file ");
  16. } Else {
  17. Header ("Location: $ ADMIN [defaurl URL]");
  18. }
  19. } Else {
  20. Header ("Location: $ ADMIN [defaurl URL]");
  21. }
  22. ?>


After testing on this site, it is a very simple and good method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.