Heim  >  Artikel  >  Backend-Entwicklung  >  php读取资料失败?

php读取资料失败?

WBOY
WBOYOriginal
2016-06-13 11:21:36822Durchsuche

php读取文件失败??

	<br />$dir=opendir(ROOT_PATH."frame/hack");<br />	while($file=readdir($dir)){<br />		if(is_file(ROOT_PATH."frame/hack/$file/data.sql")){<br />			$sql=readover(ROOT_PATH."frame/hack/$file/data.sql");<br />			preg_match_all("/INSERT INTO `qb_hack`([^']+)\('([^']+)', '([^']+)'/is",$sql,$array);<br /><br />			$_array = @include(ROOT_PATH."frame/hack/$file/fix.php");<br />			if($_array[setup]==2){<br />				$_array[input]=" checked onclick='return false' ";<br />			}elseif($_array[setup]==1){<br />				$_array[input]=' checked ';<br />			}<br /><br />			$Harray[$file]=array(<br />				'name'=>implode(',',$array[3]),<br />				'input'=>$_array[input],<br />			);<br />		}<br />	}<br />    <br />    <br />//读取与写入<br />function readover($filename,$method="rb"){<br />	if([email&#160;protected]($filename,$method)){<br />		flock($handle,LOCK_SH);<br />		$filedata=fread($handle,filesize($filename));<br />		fclose($handle);<br />	}<br />	return $filedata;<br />}<br />function writeover($filename,$data,$method="rb+",$iflock=1){<br />	touch($filename);<br />	$handle=fopen($filename,$method);<br />	if($iflock){<br />		flock($handle,LOCK_EX);<br />	}<br />	$show=fputs($handle,$data);<br />	if($method=="rb+") ftruncate($handle,strlen($data));<br />	fclose($handle);<br />	return $show;<br />}





下面是前台读取格式



  • $rs[name]

  •  





    为什么,上面那段php运行后,什么都不显示呢,是哪里有问题了??
    PHP 函数
    ------解决方案--------------------
    如果是linux上看看文件是否有权限读
    ------解决方案--------------------
    [email protected],看看是什么出错
    Stellungnahme:
    Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn