$dir=opendir(ROOT_PATH."frame/hack"); while($file=readdir($dir)){ if(is_file(ROOT_PATH."frame/hack/$file/data.sql")){ $sql=readover(ROOT_PATH."frame/hack/$file/data.sql"); preg_match_all("/INSERT INTO `qb_hack`([^']+)\('([^']+)', '([^']+)'/is",$sql,$array); $_array = @include(ROOT_PATH."frame/hack/$file/fix.php"); if($_array[setup]==2){ $_array[input]=" checked onclick='return false' "; }elseif($_array[setup]==1){ $_array[input]=' checked '; } $Harray[$file]=array( 'name'=>implode(',',$array[3]), 'input'=>$_array[input], ); } } //读取与写入function readover($filename,$method="rb"){ if($handle=@fopen($filename,$method)){ flock($handle,LOCK_SH); $filedata=fread($handle,filesize($filename)); fclose($handle); } return $filedata;}function writeover($filename,$data,$method="rb+",$iflock=1){ touch($filename); $handle=fopen($filename,$method); if($iflock){ flock($handle,LOCK_EX); } $show=fputs($handle,$data); if($method=="rb+") ftruncate($handle,strlen($data)); fclose($handle); return $show;}
如果是linux上看看文件是否有权限读
本地环境测试的
先把抑制错误的@都去掉了,看看是什么出错