{"id":367,"date":"2024-04-10T01:04:09","date_gmt":"2024-04-10T01:04:09","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=367"},"modified":"2024-04-10T01:16:35","modified_gmt":"2024-04-10T01:16:35","slug":"get-method-data-form-transmission","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2024\/04\/10\/get-method-data-form-transmission\/","title":{"rendered":"GET \ubc29\uc2dd \ud3fc \ub370\uc774\ud130 \uc804\uc1a1 GET method data form transmission"},"content":{"rendered":"\n<p>-\uc544\ub798\uc758 \uc774\ubbf8\uc9c0\uc5d0\uc11c \ubcfc \uc218 \uc788\ub294 \uac83\ucc98\ub7fc  GET\ubc29\uc2dd \ud3fc\ub370\uc774\ud130 \uc804\uc1a1\uc740 \ube0c\ub77c\uc6b0\uc800\uc758 \uc8fc\uc18c\ud45c\uc2dc\uc904\uc744 \ud1b5\ud574\uc11c \ub370\uc774\ud130\ub97c \uc804\uc1a1\ud558\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4.<br>-\uc544\ub798\uc758 \ub9c1\ud06c\ub97c \ud1b5\ud574\uc11c \ud14c\uc2a4\ud2b8 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4<br>As you can see in the image below, GET form data transmission means sending data through the browser&#8217;s address bar.<br>You can test it through the link below.<br><br><a href=\"https:\/\/freelifemakers.org\/lec\/form2.php\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/freelifemakers.org\/lec\/form2.php<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"652\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2024\/04\/20240410_092612.png\" alt=\"\" class=\"wp-image-368\" srcset=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2024\/04\/20240410_092612.png 634w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2024\/04\/20240410_092612-292x300.png 292w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/figure>\n\n\n\n<p><br>form2.php\uc640 form_action2.php\ud30c\uc77c\uc740 \uae30\uc874\uc758 form1.php\ud30c\uc77c\uacfc form2.php\ud30c\uc77c\uc744 \uc218\uc815\ud55c \ud30c\uc77c \uc785\ub2c8\ub2e4.<br>\uc544\ub798\uc758 \uc804\uccb4 \ucf54\ub4dc\uc5d0\uc11c \uadf8\ub9b0 \uceec\ub7ec\ub294 \ubcc0\uacbd\ub41c \ucf54\ub4dc \ub0b4\uc6a9\uc774\uace0 \uc624\ub80c\uc9c0 \uceec\ub7ec\ub294 \uc0c8\ub85c \ucd94\uac00\ub41c \ucf54\ub4dc \uc785\ub2c8\ub2e4.<br>The form2.php and form_action2.php files are modified files from the existing form1.php and form2.php files.<br>In the entire code below, the green color is the changed code content and the orange color is the newly added code.<br><br><br> 1.form2.php<br>\uc774\ud574\ud558\uae30 \uc27d\ub3c4\ub85d \ud558\uae30 \uc704\ud574\uc11c php\ucf54\ub4dc\uc5d0\uc11c html\ucf54\ub4dc\ub85c \uc218\uc815\ud588\uc2b5\ub2c8\ub2e4.<br>\uc5ec\uae30\uc11c \ub370\uc774\ud130 \uc804\uc1a1 \ubc29\uc2dd\uc73c\ub85c form method=&#8221;post&#8221;\uc5d0\uc11c form method=&#8221;get&#8221;\uc73c\ub85c \ubcc0\uacbd\ud588\uc2b5\ub2c8\ub2e4.<br>To make it easier to understand, I modified the PHP code to HTML code.<br>Here, the data transmission method was changed from form method=&#8221;post&#8221; to form method=&#8221;get&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-green-color\">.\/form_action2.php<\/mark>\" method=\"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-green-color\">get<\/mark>\"&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>form2.php\n\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n    &lt;head&gt;\n      &lt;title&gt;Bootstrap 5 Example&lt;\/title&gt;\n      &lt;meta charset=\"utf-8\"&gt;\n      &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"&gt;\n      &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.2.3\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\n      &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.2.3\/dist\/js\/bootstrap.bundle.min.js\"&gt;&lt;\/script&gt;\n    &lt;\/head&gt;\n    &lt;body&gt;\n        <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-green-color\">&lt;form action=\".\/form_action2.php\" method=\"get\"&gt;<\/mark>\n        &lt;div class=\"mb-3 mt-3\"&gt;\n            &lt;label for=\"name\" class=\"form-label\"&gt;\uc774\ub984(Name):&lt;\/label&gt;\n            &lt;input type=\"name\" class=\"form-control\" id=\"name\" placeholder=\"\ub2f9\uc2e0\uc758 \uc774\ub984\uc744 \uc785\ub825\ud558\uc138\uc694(Enter Your Name)\" name=\"name\"&gt;\n        &lt;\/div&gt;\n        &lt;div class=\"mb-3\"&gt;\n            &lt;label for=\"pwd\" class=\"form-label\"&gt;Password:&lt;\/label&gt;\n            &lt;input type=\"password\" class=\"form-control\" id=\"pwd\" placeholder=\"Enter password\" name=\"pswd\"&gt;\n        &lt;\/div&gt;\n            &lt;div class=\"form-check mb-3\"&gt;\n            &lt;label class=\"form-check-label\"&gt;\n            &lt;input class=\"form-check-input\" type=\"checkbox\" name=\"remember\"&gt; Remember me\n            &lt;\/label&gt;\n        &lt;\/div&gt;\n            &lt;button type=\"submit\" class=\"btn btn-primary\"&gt;Submit&lt;\/button&gt;\n        &lt;\/form&gt;\n    &lt;\/body&gt;\n&lt;\/html&gt;    \n<\/code><\/pre>\n\n\n\n<p>2.form_action2.php<br>&#8211; \ub370\uc774\ud130\uc758 GET\ubc29\uc2dd \uc804\uc1a1\uc774 \ub9de\ub294\uc9c0 \ud655\uc778 \ud558\uae30 \uc704\ud574\uc11c  $_SERVER[&#8216;REQUEST_METHOD \ub97c POST\uc5d0\uc11c &#8220;GET&#8221;\uc73c\ub85c \ubcc0\uacbd\ud588\uc2b5\ub2c8\ub2e4.<br>&#8211; $_SERVER[&#8216;REQUEST_METHOD\uc758 \uac12 \uac12\uc744 \ud655\uc778 \ud558\uae30 \uc704\ud574\uc11c \ub2e4\uc74c\uacfc \uac19\uc740 \ucf54\ub4dc\ub97c \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.<br>To check whether the GET method of data transmission is correct, $_SERVER[&#8216;REQUEST_METHOD was changed from POST to &#8220;GET&#8221;.<br>I added the following code to check the value of $_SERVER[&#8216;REQUEST_METHOD.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>form_action2.php\n\n&lt;?php  \nif($_SERVER&#91;'REQUEST_METHOD'] == \"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-green-color\">GET<\/mark>\"){\n\n   $f_name = $<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-green-color\">_GET<\/mark>&#91;'name'];\n   $f_pwd = $<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-green-color\">_GET<\/mark>&#91;'pswd'];\n}\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-orange-color\">echo \"REQUEST_METHOD:\".$_SERVER&#91;'REQUEST_METHOD'].\"&lt;br&gt;\";<\/mark>\necho $f_name.\"&lt;br&gt;\";\necho $f_pwd;\n?&gt;\n<\/code><\/pre>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/www.facebook.com\/plugins\/video.php?height=314&#038;href=https%3A%2F%2Fwww.facebook.com%2Fgideonslife01%2Fvideos%2F275291282288777%2F&#038;show_text=false&#038;width=560&#038;t=0\" width=\"560\" height=\"314\" style=\"border:none;overflow:hidden\" scrolling=\"no\" frameborder=\"0\" allowfullscreen=\"true\" allow=\"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share\" allowFullScreen=\"true\"><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>-\uc544\ub798\uc758 \uc774\ubbf8\uc9c0\uc5d0\uc11c \ubcfc \uc218 \uc788\ub294 \uac83\ucc98\ub7fc GET\ubc29\uc2dd \ud3fc\ub370\uc774\ud130 \uc804\uc1a1\uc740 \ube0c\ub77c\uc6b0\uc800\uc758 \uc8fc\uc18c\ud45c\uc2dc\uc904\uc744 \ud1b5\ud574\uc11c \ub370\uc774\ud130\ub97c \uc804\uc1a1\ud558\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4.-\uc544\ub798\uc758 \ub9c1\ud06c\ub97c \ud1b5\ud574\uc11c \ud14c\uc2a4\ud2b8 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4As you can see in the image below, GET form data transmission means sending data through the browser&#8217;s address bar.You can test it through the link below. https:\/\/freelifemakers.org\/lec\/form2.php form2.php\uc640 form_action2.php\ud30c\uc77c\uc740 \uae30\uc874\uc758 form1.php\ud30c\uc77c\uacfc form2.php\ud30c\uc77c\uc744 \uc218\uc815\ud55c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-367","post","type-post","status-publish","format-standard","hentry","category-php","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=367"}],"version-history":[{"count":3,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/367\/revisions"}],"predecessor-version":[{"id":371,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/367\/revisions\/371"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}