How to prevent hotlinking in PHP programs_PHP Tutorial

WBOY
Release: 2016-07-21 15:52:25
Original
820 people have browsed it

example:    

页面: dl.php     
--------------------------------------------------------------------------------------     

复制代码 代码如下:


$id = $_GET['id'];      
$act = $_GET['act'];      

switch($act) {      
default :      
case "display" : displayHTML(); break;      
case "down" : down(); break;      
}      

function displayHTML($id) {      
setcookie("visited", "true");      

// print your HTML.      
}      

function down($id) {      
if(! isset($_COOKIE['visited']) ) print "你盗联?";      

$sql = "select path from TABLE where id=". $id;      
//..............................      
}      
?>      

Download Now...

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/318910.htmlTechArticleexample: 页面:dl.php -------------------------------------------------------------------------------------- 复制代码 代码如下: ?php $id=$_GET['id']; $act=$_GET['act']; swi...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template