php讀取檔案失敗

來源:互聯網
上載者:User
$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上看看檔案是否有許可權讀

    本地環境測試的

    先把抑制錯誤的@都去掉了,看看是什麼出錯

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.