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

    1. <tfoot id='7RZKC'></tfoot>

      1. <small id='7RZKC'></small><noframes id='7RZKC'>

        表单 GET 有效,表单 POST 无效

        Form GET works, Form POST does not(表单 GET 有效,表单 POST 无效)

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

                • <small id='76CXu'></small><noframes id='76CXu'>

                  <tfoot id='76CXu'></tfoot>
                  本文介绍了表单 GET 有效,表单 POST 无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个简单的表单,当 method="GET" 时它的行为符合预期,但是当 method="POST" 时,它不会.

                  I have a simple form that behaves as expected when method="GET", but when method="POST", it does not.

                  表格:

                  <form action="/login" method="POST">
                  <input type="text" name="user" maxlength="30" value="">
                  <input type="password" name="pass" maxlength="30" value="">
                  <input type="hidden" name="sublogin" value="1">
                  <input type="submit" value="Login" /> 
                  </form>
                  

                  如果我将变量回显到屏幕(var_dump( $_POST )var_dump( $_GET )),当 method="POST" 时,我得到一个空大批.当 method="GET" 时,我得到一个具有适当名称/值对(用户、密码、子登录...)的数组

                  If I echo the variables to the screen (var_dump( $_POST ) or var_dump( $_GET )), when method="POST", I get an empty array. When method="GET" I get an array with the appropriate name/value pairs (user, pass, sublogin...)

                  注意事项:

                  • .htaccess 处理文件名的 .php(动作),如果文件实际上不存在,它还会将所有内容重定向到 index.php.
                  • 网站上的其他表单与 POST 配合使用也很好
                  • 表单在我的本地机器上运行良好
                  • Firebug 在使用 POST 时显示 302 Temporously Moved

                  每个请求添加的.htaccess 文件:

                  .htaccess file added per request:

                  RewriteEngine On
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteRule .$ index.php
                  

                  感谢任何帮助!

                  推荐答案

                  这个问题与我的想法并不接近.

                  The problem wasn't even close to my line of thought.

                  一个在处理后设置销毁 $_POST 数组的类行为不当,但无论如何都在销毁我的 $_POST 数组.仅在 PHP 5.3 机器上发生(警告导致类行为异常),服务器运行 5.2.

                  A class that sets destroys the $_POST array after processing was misbehaving, but was destroying my $_POST array anyway. Only happens on machines with PHP 5.3 (a warning was causing the class to misbehave), server was running 5.2.

                  谢谢 Briedis 的帮助.对不起,我带你去追鹅了!

                  Thank you, Briedis for trying to help. Sorry I led you on a goose chase!

                  当然,解决方案是编写一种更好的方法来处理该类中的警告,并且不允许 $_POST 数组被破坏.

                  The solution, of course, was to write a better way of handling warnings in that class and not allowing the $_POST array to get destroyed.

                  这篇关于表单 GET 有效,表单 POST 无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                      <tbody id='4V7vY'></tbody>
                    <tfoot id='4V7vY'></tfoot>
                          <bdo id='4V7vY'></bdo><ul id='4V7vY'></ul>
                          <i id='4V7vY'><tr id='4V7vY'><dt id='4V7vY'><q id='4V7vY'><span id='4V7vY'><b id='4V7vY'><form id='4V7vY'><ins id='4V7vY'></ins><ul id='4V7vY'></ul><sub id='4V7vY'></sub></form><legend id='4V7vY'></legend><bdo id='4V7vY'><pre id='4V7vY'><center id='4V7vY'></center></pre></bdo></b><th id='4V7vY'></th></span></q></dt></tr></i><div id='4V7vY'><tfoot id='4V7vY'></tfoot><dl id='4V7vY'><fieldset id='4V7vY'></fieldset></dl></div>
                          <legend id='4V7vY'><style id='4V7vY'><dir id='4V7vY'><q id='4V7vY'></q></dir></style></legend>

                            <small id='4V7vY'></small><noframes id='4V7vY'>