Posted in PHP onApril 09, 2008
example:
页面: dl.php
--------------------------------------------------------------------------------------
<?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; //.............................. } ?> <a href="dl.php?id=1&act=down">Download Now...</a>
如何在PHP程序中防止盗链
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@