如何在PHP程序中防止盗链_php技巧
程序员文章站
2022-06-01 15:44:56
...
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...
页面: 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...
上一篇: PHP+MYSQL 出现乱码的解决方法_php技巧
下一篇: PHP学习 mysql第1/2页