简体   繁体   English

REQUEST_METHOD默认

[英]REQUEST_METHOD default

Is $_SERVER["REQUEST_METHOD"] set to 'GET' by default? $_SERVER["REQUEST_METHOD"]是否默认设置为'GET'?

This code 这段代码

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

outputs 'GET' even if it is in an empty file with no other tags ( <html> / <form> / <?php ?> ) 即使它在没有其他标签的空文件中也输出'GET'( <html> / <form> / <?php ?>

By default the request sent by browser is always GET . 默认情况下,浏览器发送的请求始终为GET Take a look here 在这里看看

Look at this: 看这个:

17.3 The FORM element 17.3 FORM元素

 <!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 -- > 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM