{"id":22,"date":"2005-11-14T04:00:00","date_gmt":"2005-11-14T04:00:00","guid":{"rendered":"http:\/\/thenoyes.com\/littlenoise\/?p=22"},"modified":"2006-06-16T21:06:40","modified_gmt":"2006-06-16T21:06:40","slug":"form-names","status":"publish","type":"post","link":"https:\/\/thenoyes.com\/littlenoise\/?p=22","title":{"rendered":"Form Names"},"content":{"rendered":"<p>Given the following page:<\/p>\n<pre>\r\n&lt;form&gt;\r\n  &lt;input type=\"radio\" name=\"BT.123\" value=\"active\" \/&gt;\r\n  &lt;input type=\"radio\" name=\"BT.123\" value=\"inactive\" \/&gt;\r\n  &lt;input type=\"submit\" value=\"Submit\" \/&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;?php\r\n  echo \"GET: \", $_GET['BT.123'];\r\n  echo \"POST: \", $_POST['BT.123'];\r\n  echo \"REQUEST: \", $_REQUEST['BT.123'];\r\n?&gt;\r\n<\/pre>\n<p>\nAssume the &#8220;inactive&#8221; button is checked and the form is submitted.  What is the output?<br \/>\n<spoiler 'Show Answer' 'Hide Answer'>Answer: Because the &#8220;.&#8221; is converted to &#8220;_&#8221;, only the string literals (and some warnings, if using E_STRICT) are output.<\/p>\n<pre>\r\nGET: \r\nPOST:\r\nREQUEST:\r\n<\/pre>\n<p>In other words, use $_REQUEST[&#8216;BT_123&#8217;] instead.<\/spoiler><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Given the following page: &lt;form&gt; &lt;input type=&#8221;radio&#8221; name=&#8221;BT.123&#8243; value=&#8221;active&#8221; \/&gt; &lt;input type=&#8221;radio&#8221; name=&#8221;BT.123&#8243; value=&#8221;inactive&#8221; \/&gt; &lt;input type=&#8221;submit&#8221; value=&#8221;Submit&#8221; \/&gt; &lt;\/form&gt; &lt;?php echo &#8220;GET: &#8220;, $_GET[&#8216;BT.123&#8217;]; echo &#8220;POST: &#8220;, $_POST[&#8216;BT.123&#8217;]; echo &#8220;REQUEST: &#8220;, $_REQUEST[&#8216;BT.123&#8217;]; ?&gt; Assume the &#8220;inactive&#8221; button is checked and the form is submitted. What is the output? Answer: Because the &#8220;.&#8221; is converted [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-gotchas-2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2IBF1-m","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22"}],"version-history":[{"count":0,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions"}],"wp:attachment":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}