我的脚本在 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>";
?>
谁能告诉我我的脚本有什么问题或任何其他问题?
添加:
我收到此错误消息
警告:文件(Your-Backlinks.txt)[function.file]:无法打开流:第 27 行的 /home/husdemo/public_html/backlink.php 中没有这样的文件或目录警告:file_get_contents(trim)[function.file -get-contents]:无法打开流:第 35 行的 /home/husdemo/public_html/backlink.php 中没有这样的文件或目录