<legend id='1WHxc'><style id='1WHxc'><dir id='1WHxc'><q id='1WHxc'></q></dir></style></legend>

    <small id='1WHxc'></small><noframes id='1WHxc'>

      <i id='1WHxc'><tr id='1WHxc'><dt id='1WHxc'><q id='1WHxc'><span id='1WHxc'><b id='1WHxc'><form id='1WHxc'><ins id='1WHxc'></ins><ul id='1WHxc'></ul><sub id='1WHxc'></sub></form><legend id='1WHxc'></legend><bdo id='1WHxc'><pre id='1WHxc'><center id='1WHxc'></center></pre></bdo></b><th id='1WHxc'></th></span></q></dt></tr></i><div id='1WHxc'><tfoot id='1WHxc'></tfoot><dl id='1WHxc'><fieldset id='1WHxc'></fieldset></dl></div>
    1. <tfoot id='1WHxc'></tfoot>

          <bdo id='1WHxc'></bdo><ul id='1WHxc'></ul>
      1. PHP 对 GET 参数的保护

        PHP protection of GET parameters(PHP 对 GET 参数的保护)
        <i id='LWpRO'><tr id='LWpRO'><dt id='LWpRO'><q id='LWpRO'><span id='LWpRO'><b id='LWpRO'><form id='LWpRO'><ins id='LWpRO'></ins><ul id='LWpRO'></ul><sub id='LWpRO'></sub></form><legend id='LWpRO'></legend><bdo id='LWpRO'><pre id='LWpRO'><center id='LWpRO'></center></pre></bdo></b><th id='LWpRO'></th></span></q></dt></tr></i><div id='LWpRO'><tfoot id='LWpRO'></tfoot><dl id='LWpRO'><fieldset id='LWpRO'></fieldset></dl></div>
              <tbody id='LWpRO'></tbody>
              <tfoot id='LWpRO'></tfoot>
            • <legend id='LWpRO'><style id='LWpRO'><dir id='LWpRO'><q id='LWpRO'></q></dir></style></legend>
                  <bdo id='LWpRO'></bdo><ul id='LWpRO'></ul>
                • <small id='LWpRO'></small><noframes id='LWpRO'>

                  本文介绍了PHP 对 GET 参数的保护的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  好的考虑这个网址:

                  example.com/single.php?id=21424
                  

                  很明显,PHP 将获取 ID 并通过 mysql 查询运行它以检索 1 条记录以将其显示在页面上.

                  It's pretty obvious to you and i that the PHP is going to take the id and run it through a mysql query to retrieve 1 record to display it on the page.

                  无论如何,是否有一些恶意黑客可能会弄乱这个 url 并对我的应用程序/mysql 数据库构成安全威胁?

                  Is there anyway some malicious hacker could mess this url up and pose a security threat to my application/mysql DB?

                  谢谢

                  推荐答案

                  当然,永远不要认为用户条目(_GET、_POST、_COOKIE 等)是安全的.

                  Of course, never ever ever consider a user entry (_GET, _POST, _COOKIE, etc) as safe.

                  使用 mysql_real_escape_string php 函数来清理你的变量:http://php.net/manual/en/function.mysql-real-escape-string.php

                  Use mysql_real_escape_string php function to sanitize your variables: http://php.net/manual/en/function.mysql-real-escape-string.php

                  关于 SQL 注入:http://en.wikipedia.org/wiki/SQL_injection

                  这篇关于PHP 对 GET 参数的保护的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

                    <i id='EZAPx'><tr id='EZAPx'><dt id='EZAPx'><q id='EZAPx'><span id='EZAPx'><b id='EZAPx'><form id='EZAPx'><ins id='EZAPx'></ins><ul id='EZAPx'></ul><sub id='EZAPx'></sub></form><legend id='EZAPx'></legend><bdo id='EZAPx'><pre id='EZAPx'><center id='EZAPx'></center></pre></bdo></b><th id='EZAPx'></th></span></q></dt></tr></i><div id='EZAPx'><tfoot id='EZAPx'></tfoot><dl id='EZAPx'><fieldset id='EZAPx'></fieldset></dl></div>
                      <bdo id='EZAPx'></bdo><ul id='EZAPx'></ul>
                      <legend id='EZAPx'><style id='EZAPx'><dir id='EZAPx'><q id='EZAPx'></q></dir></style></legend>

                        <small id='EZAPx'></small><noframes id='EZAPx'>

                            <tbody id='EZAPx'></tbody>
                          <tfoot id='EZAPx'></tfoot>