我的腳本在localhost上正常工作,但它在我的域中不起作用。在真實主機上運行我的腳本
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
$needle = $_POST['utext'];
$file = $_POST['ufile'];
$new = file($file);
$new = array('trim', $new);
echo '#entries: ', count($new), "\n";
$found = array(); $notfound=array();
foreach ($new as $check) {
echo "<table border='1'><tr>";
echo '<td>processing = ', $check.'</td>';
$a = file_get_contents($check);
if (strpos($a,$needle)) {
echo "<td><font color='green'> found\n</font></td>";
$found[] = $check;
}
else {
echo "<td><font color='red' face='bold'> not found\n</font></td>";
$notfound[] = $check;
}
}
echo '<tr><td>#Matches: ', count($found), "</td></tr>";
echo "<br />";
echo '#No-Matches: ', count($notfound), "\n";
echo "<br />";
echo "</tr></table>";
?>
誰能告訴我我的腳本或其他問題出了什麼問題?
增加:
我收到此錯誤信息
警告:文件(您-Backlinks.txt)[function.file]:未能打開 流:在沒有這樣的文件或目錄在線27:警告: file_get_contents(trim) /backlink.php on line 35
也許PHP版本不同的是 –
也許php.ini的配置不一樣 –
如果任何錯誤消息正在顯示它會真正幫助我們如果您將它們添加到您的問題 – Dale