0

我的脚本在 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 中没有这样的文件或目录

4

2 回答 2

2

上传Your-Backlinks.txt到服务器

于 2012-11-28T10:25:45.087 回答
0

Are you using the short-tag <? rather than the full <?php tag? If so, change it to full tags, your host might very well have short-tags disabled.

于 2012-11-28T10:20:03.117 回答