php不執行的怪異有關問題

來源:互聯網
上載者:User
php不執行的怪異問題
一個html和php結合的頁面,本機運行正常,傳到空間就不能執行,其他php頁面可以正常顯示,經過測試我發現裡面有require_once語句就無法執行,換成include可以執行通過了,但是到了建立類的時候又不執行了,echo語句放到$q_Servie = new q_Service ();前面可以執行,放到後面就不執行。index_Service.class.php檔案裡面也調用類,也是相對路徑( include('/database/sqlhelper.class.php');),不知道有沒有關係。本機wamp,mysql5.5,php5.4,空間的資料庫是5.0的,請幫忙看看怎麼回事。





include("/member/index_Service.class.php");
$pagenow=0;
$pagesize=24;

$q_Servie = new q_Service ();

$res=$q_Servie->get_quan_list($pagenow, $pagesize);
for($i = 0; $i < count ( $res); $i ++) {
$row = $res [$i];
$photo = "upload_file/{$row['q_creator']}/{$row['q_photo']}";
$q_secrecy = $row ['q_secrecy'];
if ($row ['q_photo'] == "") {
$photo = "upload_file/quan.png";
}
echo " ";

}

?>


------解決方案--------------------
include('/database/sqlhelper.class.php');
include("/member/index_Service.class.php");
都是絕對路徑,載入不了是正常的
能載入才是錯誤的
------解決方案--------------------
盡量不要php代碼和html代碼混編了。一般都用smarty模板來搞了。
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.