http://www.example.com/pageView?test=111&test2=999 - >數據加載和工作..
189 <?php
190 $handle = @fopen("http://www.example.com". htmlspecialchars($_GET["test"]) ."/". htmlspecialchars($_GET["test2"]) .".txt", "r");
191 while (!feof($handle))
192 {
193 $buffer = fgets($handle, 4096);
194
195 if (strlen(trim($buffer)) > 0){
196
197 list($a,$b,$c,$d,$e,$f,$g,$h,$i,$j)=explode(",",$buffer);
198
199 $items[] = array('col1' => $a,'col2' => $b,'col3' => $c,'col4' => $d,'col5' => $e,'col6' => $f,'col7' => $g,'col8' => $h,'col9' => $i,'col10' => $j);
200 }
201 }
202 ?>
http://www.example.com/pageView?test&test2= - >不加載..這是正常的,但這個錯誤是在網頁..
Warning: feof(): supplied argument is not a valid stream resource in /home/---/public_html/---/---.php on line 191
Warning: fgets(): supplied argument is not a valid stream resource in /home/---/public_html/---/---.php on line 193
如何顯示警告信而不是錯誤頁?
[PHP - FEOF錯誤]的可能重複(http://stackoverflow.com/questions/2875971/php-feof-error) – RiaD
從fopen中刪除錯誤抑制調用線索以瞭解發生了什麼 – Orangepill