$ADMIN[defaulturl] = http://www.163.com/404.htm; //盜鏈回傳的位址
$okaysites = array("http://www.163.com/","http ://163.com") ; //白名單
$ADMIN[url_1] = http://www.163.com/download/; //下載地點1
$ADMIN[url_2] = " ";//下載地點2,此類推
$reffer = $HTTP_REFERER;
if($reffer) {
$yes = 0;
$subarray) = each($okaysites)) {
if (ereg($subarray,"$reffer")) {
$yes = 1;
} "url"."_"."$site";
if ($ADMIN[$theu] AND $yes == 1) {
header("Location: $ADMIN[$theu]/$file" );
} else {
header("Location: $ADMIN[defaulturl]");
}
} else {
headM(
}
?>
使用方法:將上述程式碼儲存為dao4.php,
例如測試用的validatecode.rar在網站http://163 .com/download裡面,
則用以下程式碼表示下載連線.
檔名?site=1&file=檔
http://www.bkjia.com/PHPjc/317312.html