2015-10-18 114 views
-2

我有一個網站,我有幾個問題。我不確定託管公司是否改變了某些內容或網站遭到黑客入侵。我希望這是好的,因爲我列出了用戶嘗試註冊該網站時的錯誤列表。當用戶嘗試使用搜索功能時也會發生這種情況,但是在搜索功能中,錯誤出現在頂部,然後搜索結果實際顯示在下面。註冊頁面不顯示任何內容,但出現以下錯誤。警告:包括(dbconn.php):未能打開流:沒有這樣的文件或目錄

Warning: include(dbconn.php): failed to open stream: No such file or directory in /home1/hoapres/public_html/users/register/index.php on line 26 

Warning: include(dbconn.php): failed to open stream: No such file or directory in /home1/hoapres/public_html/users/register/index.php on line 26 

Warning: include(): Failed opening 'dbconn.php' for inclusion (include_path='.:/opt/php54/lib/php') in /home1/hoapres/public_html/users/register/index.php on line 26 

Warning: include(functions.php): failed to open stream: No such file or directory in /home1/hoapres/public_html/users/register/index.php on line 27 

Warning: include(functions.php): failed to open stream: No such file or directory in /home1/hoapres/public_html/users/register/index.php on line 27 

Warning: include(): Failed opening 'functions.php' for inclusion (include_path='.:/opt/php54/lib/php') in /home1/hoapres/public_html/users/register/index.php on line 27 

Fatal error: Call to undefined function userText2Web() in /home1/hoapres/public_html/users/register/index.php on line 40 

回答

-1

您的問題是您使用的路徑不正確。 請檢查你的代碼,你必須包括像

include("dbconn.php"); 

的文件,你可以通過這種方式

$fullpath = "http://yourdomain.com/"; 

嘗試如果dbconn.php任何文件夾下,然後

$fullpath = "http://yourdomain.com/foldername/"; 

include($fullpath."dbconn.php"); 
+0

包括應該使用的文件路徑,而不是URL。 –

0

無知道你的目錄結構很難提供一個精確的答案,但在試圖包含文件之前我會做的第一件事是明確地設置你的包含路徑。

假設站點根目錄(DOCUMENT_ROOT)是/home1/hoapres/public_html,你有用於存儲所有叫includes您的包含文件的文件夾,路徑將是/home1/hoapres/public_html/includes

<?php 

    set_include_path($_SERVER['DOCUMENT_ROOT'] . '/includes'); 
    if(!realpath(get_include_path())) exit('Bad path'); 

    /* Test to see what files exist perhaps */ 
    print_r(glob(get_include_path() . '/*.*')); 

    /* Can you see the files you expect? */ 
    include 'dbconn.php'; 
    include 'functions.php'; 

?> 
相關問題