2017-11-15 9 views
0

$_SERVER["REQUEST_METHOD"]은 기본적으로 '가져 오기'로 설정되어 있습니까?REQUEST_METHOD 기본값

이 코드

<?php echo $_SERVER["REQUEST_METHOD"]; ?> 
가 다른 태그 ( <html>/ <form>/ <?php ?>)와 빈 파일에있는 경우에도

출력 'GET'은 기본적으로

답변

1

브라우저가 보낸 요청이 항상 GET . 이것 좀 봐에게 here

살펴 보자 :

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