首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

反盗链种

2012-12-20 
反盗链类?php$ADMIN[defaulturl] test.gif//盗链返回的地址$okaysites array(http://www.deograp

反盗链类

<?php$ADMIN[defaulturl] = "test.gif";//盗链返回的地址$okaysites = array("http://www.deographics.com/","http://deographics.com/");  //白名单  $ADMIN[url_1] = "http://deographics.com/";//下载地点1$ADMIN[url_2] = ""; //下载地点2,以此类推 $reffer = $HTTP_REFERER;if($reffer) {$yes = 0;while(list($domain, $subarray) = each($okaysites)) {if (ereg($subarray,"$reffer")) {$yes = 1;}}$theu = "url"."_"."$site";if ($ADMIN[$theu] AND $yes == 1) {header("Location: $ADMIN[$theu]/$file");} else {header("Location: $ADMIN[defaulturl]");}} else {header("Location: $ADMIN[defaulturl]");}

热点排行