$url=trim(getenv("REQUEST_URI"));//返回:/static/forum/forumid/a-b/page.html /statics/thread/$mod/threadid/page.html if (strstr($url,"topic_list.asp")){ $urls = explode('=',$url); $forumid = intval($urls[1]); Header("Location: /viewforum-$forumid.html"); exit; }else if(strstr($url,"forumview.asp?topic_id=")){ $url = str_replace('forumview.asp?topic_id=','viewthread.php?t=',$url); Header("Location: $url"); exit; }else if(strstr($url,"forumview.asp?td=0&topic_id=")){ $url = str_replace('forumview.asp?td=0&topic_id=','viewthread.php?t=',$url); Header("Location: $url"); exit; }else if(strstr($url,"/you_are_better_one/")){ $contents = readFromFile("/data/ipallow/link.conf"); if(strstr($contents,$url)){ insertToFile("/data/ipallow/allowips.conf",$_SERVER["REMOTE_ADDR"]); $contents = str_replace("http://hongdou.gxnews.com.cn"."$url\n","",$contents); //writeToFile("/data/ipallow/link.conf",$contents); } } //################### 从文件中读取出内容 ####################### function readFromFile($filename){ if(!is_file($filename)) return ''; $fp=fopen($filename,'r'); $str = fread($fp,filesize($filename)); fclose($fp); return $str; } //##################### 写入内容到文件 ######################### function writeToFile($filename,$content){ $fp=fopen($filename,'w'); //打开文件 flock($fp,LOCK_EX); fwrite($fp,$content); //写入信息 flock($fp, LOCK_UN); // 释放锁定 fclose($fp); @chmod($filename, 0777); } //##################### 写入内容到文件 ######################### function insertToFile($filename,$content){ $fp=fopen($filename,'a'); //打开文件 flock($fp,LOCK_EX); fwrite($fp,$content."\n"); //写入信息 flock($fp, LOCK_UN); // 释放锁定 fclose($fp); @chmod($filename, 0777); } ?>
![]() |
如果您是由收藏夹进来的:
|
| 您要查看的网页可能已被删除、名称已被更改,或者暂时不可用。 | |
请尝试以下操作:
HTTP 404 - 未找到文件
|
|