PHP methods for server-side predefined variable invocation and string processing

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

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.