$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;}
下面是前台读取格式
$rs[name]
为什么,上面那段php运行后,什么都不显示呢,是哪里有问题了??
回复讨论(解决方案) 如果是linux上看看文件是否有权限读
本地环境测试的
先把抑制错误的@都去掉了,看看是什么出错
