動態網站學習筆記(2)

來源:互聯網
上載者:User

1. 在頁面上顯示PHP的worning、notice等的代碼

error_reporting(E_ALL);ini_set("display_errors", TRUE);

  

2. 寫php代碼的時候,應該盡量避免調用函數,比如

<?php     if (...) {        print "<b>hello</b>";    }?>

應該寫成

<?php if (...) : ?>        <b>hello</b><?php endif ?>

這樣就減少了函數調用,可以提高效率

 

3. 如果遇到可能會出錯的地方,用@標記,就不會在介面上顯示worning、notice等

4. 表單裡,如果某一項沒有填內容,那麼提交資料的時候就不會有這個內容,即雜湊表裡沒有這個關鍵字,因此想擷取這個內容的時候也不能直接用這個關鍵字。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.