2012-11-28 22 views
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>"; 

?> 

誰能告訴我我的腳本或其他問題出了什麼問題?

增加:

我收到此錯誤信息

警告:文件(您-Backlinks.txt)[function.file]:未能打開 流:在沒有這樣的文件或目錄在線27:警告: file_get_contents(trim) /backlink.php on line 35

+0

也許PHP版本不同的是 –

+0

也許php.ini的配置不一樣 –

+0

如果任何錯誤消息正在顯示它會真正幫助我們如果您將它們添加到您的問題 – Dale

回答

0

您是使用短標籤<?而不是完整的<?php標籤嗎?如果是這樣,請將其更改爲完整標籤,您的主機可能會禁用短標籤。

2

上傳你-Backlinks.txt服務器

在本地和遠程服務器
+0

allow_url_fopen已經在 – Honey

+0

我已經上傳了,但這一次也是一樣的結果 – Honey

+0

你是否收到同樣的錯誤信息? –

相關問題