<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BinaryKitten&#039;s Blog &#187; raw post</title>
	<atom:link href="http://binarykitten.me.uk/tag/raw-post/feed" rel="self" type="application/rss+xml" />
	<link>http://binarykitten.me.uk</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 10:33:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>php: processing raw Post / Get Values</title>
		<link>http://binarykitten.me.uk/dev/php/95-php-processing-raw-post-get-values.html</link>
		<comments>http://binarykitten.me.uk/dev/php/95-php-processing-raw-post-get-values.html#comments</comments>
		<pubDate>Wed, 21 Jan 2009 09:03:53 +0000</pubDate>
		<dc:creator>BinaryKitten</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[raw post]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://binarykitten.jkrswebsolutions.co.uk/?p=95</guid>
		<description><![CDATA[I just added a jquery plugin to call head requests, but because you are not doing a get or post request php won&#8217;t convert the values that are sent back to their form. To get around this we have to use the php://input stream ( is that the right word?) which is handy for a [...]]]></description>
			<content:encoded><![CDATA[<p>I just added a <a href="http://binarykitten.jkrswebsolutions.co.uk/2009/01/21/jquery-plugin-ajax-head-request/">jquery plugin</a> to call head requests, but because you are not doing a get or post request php won&#8217;t convert the values that are sent back to their form.<br />
To get around this we have to use the php://input stream ( is that the right word?) which is handy for a lot of things.</p>
<pre class="brush: php">
$data = file_get_contents(&quot;php://input&quot;);
$lines = explode(&quot;&amp;&quot;,$data);
foreach($lines as $line) {
    list($key,$value) = explode(&quot;=&quot;,$line,2);
    $_REQUEST[$key] = $value;
}
</pre>
<p>basically this grabs the data from the php://input and then splits it up into it&#8217;s component parts and then stores that within the $_REQUEST superglobal array.<br />
Why $_REQUEST  well we&#8217;re calling a head request and not a post or get request, so where else should it go.</p>
<p>The php://input is handy when doing stuff like xmlRPC or jsonRPC etc .. </p>
<p>Hopefully this will benefit someone out there</p>
<p>&lt;edit&gt;<br />
Thanks to Mortal of #php on OFTC (irc) for pointing out the unlimited explode </p>
]]></content:encoded>
			<wfw:commentRss>http://binarykitten.me.uk/dev/php/95-php-processing-raw-post-get-values.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
