对盗链说再见...
第一页内随机的产生一个数(0-15)-》dechex()保存在session内
然后将URL使用此标记进行运算,随便你运算了,不过要能逆过来才行~
第二页则检测是否有此标记,有则进行逆运算,然后将变量取出
优点:(必须访问站点URL才有效~)
缺点:(保存到本地的页面链接全部失效,盗链失效)
---------------------------------------------
ob_start();
session_start();
if(isset($_SESSION[key])){ //有钥匙
$key=$_SESSION[key]; //获得钥匙
$str=$_SERVER[QUERY_STRING]; //获得被加密数据
$decryptstr=decrypt($str,$key); //使用钥匙解开数据(注意,这里就是你的逆算法)
................................//(分解数据到变量中)
}else{ //无钥匙
$key=dechex(rand(0,15)); //产生钥匙
//如果您本页已经是最后一页,而不允许盗链的链接的话
//echo "您的链接并非来自本站!请访问站点后访问此页...";
//exit();
}
?>
HTML内容..............(这里包含很多链接的...)
$htmlcontent=ob_get_contents(); //获取所有HTML内容
............................... //替换所有连接参数href=url?被替换的数据(一组正则)
ob_end_flush(); //输出HTML内容(href=已经加密后的数据)
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

An unpatchable Yubico two-factor authentication key vulnerability has broken the security of most Yubikey 5, Security Key, and YubiHSM 2FA devices. The Feitian A22 JavaCard and other devices using Infineon SLB96xx series TPMs are also vulnerable.All

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.
