HTTP anti-theft chain some simple settings

Source: Internet
Author: User

Create 1.html in local folder and another folder, respectively

<a href= "" > Connect to A.php</a>

Connect to a.php separately

<?php

//HTTP_REFERER   引导用户代理到当前页的前一页的地址(如果存在)。由 user agent 设置决定。并不是所有的用户代理都会设置该项,有的还提供了修改       HTTP_REFERER 的功能。简言之,该值并不可信。 


if ($_server["Http_referer"]) {
# code ...

Strpos Find where the string first appears
if (Strpos ($_server["Http_referer"], "http://localhost/PHP") = = 0) {
# code ...
echo "You can access";
}else{
echo "You cannot access";
}
}else{
echo "You son wants to hotlinking ah";
}
?>

HTTP anti-theft chain some simple settings

Related Article

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.