<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                <table width="100%" border="0" cellspacing="0" cellpadding="5" bgcolor="#649CCC"><tr valign="middle"><td align="left"> <p class="p_Heading1"><span class="f_Heading1">第三章 數據庫及SQL</span></p> </td> <td align="right"> <span style="font-size: 9pt"> <a href="introduction.htm">Top</a>? <a href="new_item23.htm">Previous</a>? <a href="new_item25.htm">Next</a> </span> </td> </tr></table> <table width="100%" border="0" cellspacing="0" cellpadding="5"><tr valign="top"><td align="left"><p style="line-height: 1.50;"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 第三章 數據庫及SQL</p><p style="line-height: 1.50;"> ? PHP的作用常常是溝通各種數據源及用戶的橋梁。事實上,有些人認為PHP更像是一個平臺而不是一個編程語言。基于這些原因,PHP頻繁用于與數據庫的交流。</p><p style="line-height: 1.50;"> ? PHP可以很好的勝任這個任務,其原因特別是由于它能與很多種數據庫連接。下面列舉了PHP支持的小部分數據庫:</p><p style="line-height: 1.50;">DB2</p><p style="line-height: 1.50;">ODBC</p><p style="line-height: 1.50;">SQLite</p><p style="line-height: 1.50;">InterBase</p><p style="line-height: 1.50;">Oracle</p><p style="line-height: 1.50;">Sybase</p><p style="line-height: 1.50;">MySQL</p><p style="line-height: 1.50;">PostgreSQL</p><p style="line-height: 1.50;">DBM</p><p style="line-height: 1.50;">?</p><p style="line-height: 1.50;"> ? 與任何的遠程數據存儲方式相同,數據庫本身也存在著一些風險。盡管數據庫安全不是本書討論的問題,但數據庫安全是需要時刻注意的,特別是關于如何對待從數據庫讀取作為輸入的數據的問題。</p><p style="line-height: 1.50;"> ? 正如第一章所討論的,所有輸入必需要進行過濾,同時所有的輸出必須要轉義。當處理數據庫時,意味著所有來自數據庫的數據要過濾,所有寫入數據庫的數據要進行轉義。</p><p style="line-height: 1.50;">?</p><p style="line-height: 1.50;"><span style="font-weight: bold;">小提示</span></p><p style="line-height: 1.50;"> ? 常犯的錯誤是忘記了SELECT語句本身是向數據庫傳送的數據。盡管該語句的目的是取得數據,但語句本身則是輸出。</p><p style="line-height: 1.50;">?</p><p style="line-height: 1.50;"> ? 很多PHP開發人員不會去過濾來自數據庫的數據,他們認為數據庫內保存的是已過濾的數據。雖然這種做法的安全風險是很小的,但是這不是最好的做法,同時我也不推薦這樣做。這種做法是基于對數據庫安全的絕對信任,但同時違反了深度防范的原則。如果惡意數據由于某些原因被注入了數據庫,如果你有過濾機制的話,就能發現并抓住它。請記住,冗余的安全措施是有價值的,這就是一個很好的例子。</p><p style="line-height: 1.50;"> ? 本章包括了其它幾個需要關心的主題,包括訪問權限暴露及SQL注入。SQL注入是需要特別關注的,這是因為在流行的PHP應用中頻繁發現了SQL注入漏洞。</p><p style="line-height: 1.50;">?</p><hr noshade="noshade" size="1"/><p style="line-height: 1.50;">?</p></td></tr></table>
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看