<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":4539,"date":"2022-08-02T07:24:43","date_gmt":"2022-08-02T07:24:43","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=4539"},"modified":"2022-08-02T08:51:39","modified_gmt":"2022-08-02T08:51:39","slug":"what-are-the-methods-to-submit-form-in-php","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/","title":{"rendered":"What are the methods to submit form in PHP ?"},"content":{"rendered":"<ul>\n<li style=\"text-align: justify;\">In PHP we can create and use forms in which we need to use PHP superglobals <a href=\"https:\/\/www.wikitechy.com\/php\/php-get\">$_GET<\/a> and <a href=\"https:\/\/www.wikitechy.com\/php\/php-post\">$_POST<\/a> to get form data.<\/li>\n<li style=\"text-align: justify;\">If the form request get or post we need to use $_GET, for post request $_POST to retrieve data from get request.<\/li>\n<li style=\"text-align: justify;\">In this get request is the default form request in which the data is passed through get request is visible on the URL browser so it is not secured and we can send\u00a0limited amount of data through get request.<\/li>\n<li style=\"text-align: justify;\">Post request is widely used to submit form that have large amount of data such as image upload, file upload, registration form, login form, etc.<\/li>\n<li style=\"text-align: justify;\">In this the data passed through post request is not visible on the URL browser so it is secured and we can send large amount of data through post request.<\/li>\n<\/ul>\n<h2 id=\"sample-code\">Sample Code<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-php code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-php code-embed-code\">&lt;html&gt;<br\/>&lt;body&gt;<br\/><br\/>&lt;form action=&quot;welcome_get.php&quot; method=&quot;get&quot;&gt;<br\/>Name: &lt;input type=&quot;text&quot; name=&quot;name&quot;&gt;&lt;br&gt;<br\/>E-mail: &lt;input type=&quot;text&quot; name=&quot;email&quot;&gt;&lt;br&gt;<br\/>&lt;input type=&quot;submit&quot;&gt;<br\/>&lt;\/form&gt;<br\/><br\/>&lt;\/body&gt;<br\/>&lt;\/html&gt;<\/code><\/pre> <\/div>\n<h2 id=\"output\">Output<\/h2>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4540\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png\" alt=\"\" width=\"1289\" height=\"482\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png 1289w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function-300x112.png 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function-1024x383.png 1024w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function-768x287.png 768w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function-390x146.png 390w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function-820x307.png 820w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function-1180x441.png 1180w\" sizes=\"(max-width: 1289px) 100vw, 1289px\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-4541\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php.png\" alt=\"\" width=\"1288\" height=\"555\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php.png 1288w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php-300x129.png 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php-1024x441.png 1024w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php-768x331.png 768w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php-390x168.png 390w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php-820x353.png 820w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/methods-to-submit-form-in-php-1180x508.png 1180w\" sizes=\"(max-width: 1288px) 100vw, 1288px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In PHP we can create and use forms in which we need to use PHP superglobals $_GET and $_POST to get form data. If the form request get or post we need to use $_GET, for post request $_POST to retrieve data from get request. In this get request is the default form request in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[8182],"tags":[17678,8358,17676,17673,17674,17682,17683,17672,17677,17681,17679,17680,17675],"class_list":["post-4539","post","type-post","status-publish","format-standard","hentry","category-php","tag-form-submit-in-php-mysql","tag-get-and-post-method-in-php","tag-how-to-access-submitted-form-data-in-php","tag-how-to-check-form-sumbission-in-php","tag-how-to-submit-a-form-using-php","tag-how-to-submit-php-form","tag-method-get-form","tag-php-form-handling","tag-php-form-processing-with-an-example","tag-php-form-submit-get-method","tag-php-form-submit-to-database","tag-what-are-the-methods-to-submit-form-in-php","tag-working-with-forms-in-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What are the methods to submit form in PHP ? - PHP Form Handling<\/title>\n<meta name=\"description\" content=\"What are the methods to submit form in PHP ? - In PHP we can create and use forms in which we need to use PHP superglobals $_GET and $_POST\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are the methods to submit form in PHP ? - PHP Form Handling\" \/>\n<meta property=\"og:description\" content=\"What are the methods to submit form in PHP ? - In PHP we can create and use forms in which we need to use PHP superglobals $_GET and $_POST\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-02T07:24:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-02T08:51:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png\" \/>\n<meta name=\"author\" content=\"webmaster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webmaster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/\",\"name\":\"What are the methods to submit form in PHP ? - PHP Form Handling\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png\",\"datePublished\":\"2022-08-02T07:24:43+00:00\",\"dateModified\":\"2022-08-02T08:51:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4\"},\"description\":\"What are the methods to submit form in PHP ? - In PHP we can create and use forms in which we need to use PHP superglobals $_GET and $_POST\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/#primaryimage\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png\",\"contentUrl\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png\",\"width\":1289,\"height\":482},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4\",\"name\":\"webmaster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"caption\":\"webmaster\"},\"sameAs\":[\"https:\/\/www.wikitechy.com\/interview-questions\"],\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are the methods to submit form in PHP ? - PHP Form Handling","description":"What are the methods to submit form in PHP ? - In PHP we can create and use forms in which we need to use PHP superglobals $_GET and $_POST","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/","og_locale":"en_US","og_type":"article","og_title":"What are the methods to submit form in PHP ? - PHP Form Handling","og_description":"What are the methods to submit form in PHP ? - In PHP we can create and use forms in which we need to use PHP superglobals $_GET and $_POST","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/","og_site_name":"Wikitechy","article_published_time":"2022-08-02T07:24:43+00:00","article_modified_time":"2022-08-02T08:51:39+00:00","og_image":[{"url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png"}],"author":"webmaster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webmaster","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/","name":"What are the methods to submit form in PHP ? - PHP Form Handling","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png","datePublished":"2022-08-02T07:24:43+00:00","dateModified":"2022-08-02T08:51:39+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"description":"What are the methods to submit form in PHP ? - In PHP we can create and use forms in which we need to use PHP superglobals $_GET and $_POST","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/php\/what-are-the-methods-to-submit-form-in-php\/#primaryimage","url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png","contentUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/08\/get-function.png","width":1289,"height":482},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4","name":"webmaster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","caption":"webmaster"},"sameAs":["https:\/\/www.wikitechy.com\/interview-questions"],"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=4539"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4539\/revisions"}],"predecessor-version":[{"id":4542,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4539\/revisions\/4542"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=4539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=4539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=4539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}