<?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>PHP Reference Book Blog &#187; query string</title>
	<atom:link href="http://www.phpreferencebook.com/tag/query-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpreferencebook.com</link>
	<description>PHP Reference: Beginner to Intermediate PHP5</description>
	<lastBuildDate>Wed, 25 Aug 2010 12:58:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Display a Query String Value on a Web Page</title>
		<link>http://www.phpreferencebook.com/tips/display-query-string/</link>
		<comments>http://www.phpreferencebook.com/tips/display-query-string/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 05:15:23 +0000</pubDate>
		<dc:creator>Mario Lurig</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[$_GET]]></category>
		<category><![CDATA[$_SERVER]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[urldecode]]></category>

		<guid isPermaLink="false">http://www.phpreferencebook.com/?p=57</guid>
		<description><![CDATA[It seems simple, almost basic, but many people want to display the contents of a query string on a page for the user or just for troubleshooting purposes. Everyone does it, everyone needs to do it, and there are a few different options I&#8217;m going to introduce below. First, our sample URL: http://www.phpreferencebook.com/?variable=value&#038;name=Mario%20Lurig&#038;gender=male%21 or http://www.phpreferencebook.com/?variable=value&#038;name=Mario [...]]]></description>
			<content:encoded><![CDATA[<p>It seems simple, almost basic, but many people want to display the contents of a query string on a page for the user or just for troubleshooting purposes. Everyone does it, everyone needs to do it, and there are a few different options I&#8217;m going to introduce below. First, our sample URL:</p>
<pre>http://www.phpreferencebook.com/?variable=value&#038;name=Mario%20Lurig&#038;gender=male%21</pre>
<p> or</p>
<pre>http://www.phpreferencebook.com/?variable=value&#038;name=Mario Lurig&#038;gender=male!</pre>
<ol>
<li>Display the whole string (everything after the question mark)</li>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>variable=value&#038;name=Mario%20Lurig&#038;gender=male</pre>
</li>
</ul>
</ul>
<li>Display the whole string decoded (convert %## to original characters)</li>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">urldecode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>variable=value&#038;name=Mario Lurig&#038;gender=male!</pre>
</li>
</ul>
</ul>
<li>Show each variable and value as an array (already decoded)</li>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>Array ( [variable] => value [name] => Mario Lurig [gender] => male!</pre>
</li>
</ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;pre&gt;'</span><span style="color: #339933;">;</span> <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt; /pre&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</li>
<ul>
<li>
<pre>Array
(
    [variable] => value
    [name] => Mario Lurig
    [gender] => male!
)
</pre>
</li>
</ul>
</ul>
</ol>
<p>There are lots of options from there, so don&#8217;t let this be the end of your exploration of how to display a query string value on a page. If you have any great tricks, feel free to share them in the comments below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpreferencebook.com/tips/display-query-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>$_SERVER[&#039;QUERY_STRING&#039;] in Global Variables</title>
		<link>http://www.phpreferencebook.com/corrections/_serverquery_string/</link>
		<comments>http://www.phpreferencebook.com/corrections/_serverquery_string/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 04:50:37 +0000</pubDate>
		<dc:creator>Mario Lurig</dc:creator>
				<category><![CDATA[Corrections]]></category>
		<category><![CDATA[$_SERVER]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[query_string]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.phpreferencebook.com/?p=8</guid>
		<description><![CDATA[(pg. 33) The description in the book reads: $_SERVER['QUERY_STRING'] – The current scripts path This description is the same as the entry above, because I made a bad edit (copy/paste for formatting). The correct description would be as follows: $_SERVER['QUERY_STRING'] – The current query string (without the question mark) The example is correct and accurate, [...]]]></description>
			<content:encoded><![CDATA[<h3>(pg. 33)</h3>
<p>The description in the book reads:</p>
<blockquote><p>$_SERVER['QUERY_STRING'] – The current scripts path</p></blockquote>
<p>This description is the same as the entry above, because I made a bad edit (copy/paste for formatting). The correct description would be as follows:</p>
<blockquote><p>$_SERVER['QUERY_STRING'] – The current query string (without the question mark)</p></blockquote>
<p>The example is correct and accurate, and luckily this is painfully obvious thanks to the name of the key <em>QUERY_STRING </em>in the $_SERVER array.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpreferencebook.com/corrections/_serverquery_string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
