<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: GET+POST in same form?</title>
	<link>http://ask.metafilter.com/49473/GETPOST-in-same-form/</link>
	<description>Comments on Ask MetaFilter post GET+POST in same form?</description>
	<pubDate>Thu, 26 Oct 2006 09:10:06 -0800</pubDate>
	<lastBuildDate>Thu, 26 Oct 2006 09:10:06 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: GET+POST in same form?</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form</link>	
		<description>Is it possible to set the &lt;code&gt;action&lt;/code&gt; attribute of an HTML form, such that the &lt;code&gt;method&lt;/code&gt; is &lt;code&gt;POST&lt;/code&gt;, but the &lt;code&gt;action&lt;/code&gt; includes GET variables? &lt;br /&gt;&lt;br /&gt; For example, I&apos;d like the following code:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;&amp;lt;form name=&quot;edit_name&quot; action=&quot;.?debug&quot; method=&quot;post&quot;&amp;gt;&lt;br&gt;
&amp;lt;input type=&quot;submit&quot; value=&quot;Edit&quot;&amp;gt;&lt;br&gt;
&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
to return GET value containing &lt;code&gt;debug&lt;/code&gt; and a POST value containing &lt;code&gt;Edit&lt;/code&gt;.&lt;br&gt;
&lt;br&gt;
Is this reasonable or possible?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.49473</guid>
		<pubDate>Thu, 26 Oct 2006 09:02:17 -0800</pubDate>
		<dc:creator>Blazecock Pileon</dc:creator>
		
			<category>html</category>
		
			<category>form</category>
		
			<category>action</category>
		
			<category>get</category>
		
			<category>post</category>
		
	</item> <item>
		<title>By: Aidan Kehoe</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#751590</link>	
		<description>It&apos;s possible, sure. That syntax won&apos;t work, though; you&apos;ll need to give the path to the page, which probably isn&apos;t a single dot.&lt;br&gt;
&lt;br&gt;
If you&apos;re using something proprietary as a server-side language, they may not have support for it, because it&apos;s not really idiomatic. PHP and Perl certainly do, and I would be shocked if Ruby and Python didn&apos;t. But that wasn&apos;t your question :-) .</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-751590</guid>
		<pubDate>Thu, 26 Oct 2006 09:10:06 -0800</pubDate>
		<dc:creator>Aidan Kehoe</dc:creator>
	</item><item>
		<title>By: Blazecock Pileon</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#751594</link>	
		<description>Doesn&apos;t seem to work, even with a fully-specified path in the action. Only the GET variable gets through; POST is empty. I&apos;m using PHP.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-751594</guid>
		<pubDate>Thu, 26 Oct 2006 09:13:25 -0800</pubDate>
		<dc:creator>Blazecock Pileon</dc:creator>
	</item><item>
		<title>By: matthewr</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#751604</link>	
		<description>Yeah, the HTML you posted isn&apos;t quite right.&lt;br&gt;
&lt;br&gt;
Try this:&lt;br&gt;
&lt;code&gt;&amp;lt;form name=&quot;edit_name&quot; action=&quot;&lt;strong&gt;this.php&lt;/strong&gt;?debug&quot; method=&quot;post&quot;&amp;gt;&lt;br&gt;&amp;lt;input type=&quot;submit&quot; &lt;strong&gt;name=&quot;myfield&quot;&lt;/strong&gt; value=&quot;Edit&quot;&amp;gt;&lt;br&gt;&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
The problem was your input button didn&apos;t have a name attribute. Now, after clicking edit, your PHP $_GET superglobal should contain the &apos;debug&apos; field, with no value, and $_POST will contain the &apos;myfield&apos; field, with value &apos;Edit&apos;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-751604</guid>
		<pubDate>Thu, 26 Oct 2006 09:20:33 -0800</pubDate>
		<dc:creator>matthewr</dc:creator>
	</item><item>
		<title>By: Blazecock Pileon</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#751610</link>	
		<description>I&apos;m a dummy; thanks so much.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-751610</guid>
		<pubDate>Thu, 26 Oct 2006 09:24:02 -0800</pubDate>
		<dc:creator>Blazecock Pileon</dc:creator>
	</item><item>
		<title>By: ook</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#751615</link>	
		<description>Out of curiosity, why would you want to mix GET and POST?  Wouldn&apos;t it be easier (and less hacky) to just use POST for all the variables?&lt;br&gt;
&lt;br&gt;
&amp;lt;input type=&quot;hidden&quot; name=&quot;debug&quot; value=&quot;whatever&quot;&amp;gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-751615</guid>
		<pubDate>Thu, 26 Oct 2006 09:26:43 -0800</pubDate>
		<dc:creator>ook</dc:creator>
	</item><item>
		<title>By: Blazecock Pileon</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#751643</link>	
		<description>I&apos;d like to be able to debug variables &quot;on the fly&quot; as I write methods, whether or not I&apos;ve triggered a form.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-751643</guid>
		<pubDate>Thu, 26 Oct 2006 09:47:40 -0800</pubDate>
		<dc:creator>Blazecock Pileon</dc:creator>
	</item><item>
		<title>By: IshmaelGraves</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#751747</link>	
		<description>&lt;i&gt;That syntax won&apos;t work, though; you&apos;ll need to give the path to the page, which probably isn&apos;t a single dot.&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
You can also get away with just &lt;code&gt;?foo=bar&lt;/code&gt; bit:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;&amp;lt;form name=&quot;edit_name&quot; action=&quot;?debug&quot; method=&quot;post&quot;&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
The browser (well, Firefox and IE, at least) will construct the URI appropriately, saving you a little URL munging.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-751747</guid>
		<pubDate>Thu, 26 Oct 2006 11:06:09 -0800</pubDate>
		<dc:creator>IshmaelGraves</dc:creator>
	</item><item>
		<title>By: cyrusdogstar</title>
		<link>http://ask.metafilter.com/49473/GETPOST-in-same-form#752041</link>	
		<description>FWIW you can also do &quot;./?blahblahblah&quot; if you want to be both explicit (&quot;I want to access the same URL/resource that I&apos;m currently at&quot;) and terse.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.49473-752041</guid>
		<pubDate>Thu, 26 Oct 2006 14:44:02 -0800</pubDate>
		<dc:creator>cyrusdogstar</dc:creator>
	</item>
	</channel>
</rss>
