REQUEST_METHOD默认

REQUEST_METHOD default

$_SERVER["REQUEST_METHOD"] 默认设置为 'GET'?

这个代码

<?php echo $_SERVER["REQUEST_METHOD"]; ?>

输出 'GET' 即使它在没有其他标签的空文件中 (<html> / <form> / <?php ?>)

默认浏览器发送的请求总是GET。看看here

看看这个:

17.3 The FORM element

<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
<!ATTLIST FORM
  %attrs;                              -- %coreattrs, %i18n, %events --
  action      %URI;          #REQUIRED -- server-side form handler --
  method      (GET|POST)     GET       -- HTTP method used to submit the form--
  enctype     %ContentType;  "application/x-www-form-urlencoded"
  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
  name        CDATA          #IMPLIED  -- name of form for scripting --
  onsubmit    %Script;       #IMPLIED  -- the form was submitted --
  onreset     %Script;       #IMPLIED  -- the form was reset --
  accept-charset %Charsets;  #IMPLIED  -- list of supported charsets --
  >