<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A quick PHP function to get Post, Get, or Session variables; and Cookies too</title>
	<atom:link href="http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/</link>
	<description>Random articles on whatever I feel like...</description>
	<lastBuildDate>Tue, 07 Feb 2012 22:30:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Ryan</title>
		<link>http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/comment-page-1/#comment-83341</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 15 Jun 2009 17:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nutt.net/archive/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/52.html#comment-83341</guid>
		<description>Oh, it&#039;s not secure at all the way it&#039;s written.  I typically run those arrays through another function first to escape out what&#039;s received.</description>
		<content:encoded><![CDATA[<p>Oh, it&#8217;s not secure at all the way it&#8217;s written.  I typically run those arrays through another function first to escape out what&#8217;s received.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels Bom</title>
		<link>http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/comment-page-1/#comment-83291</link>
		<dc:creator>Niels Bom</dc:creator>
		<pubDate>Sun, 14 Jun 2009 16:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nutt.net/archive/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/52.html#comment-83291</guid>
		<description>1) remember safety, don&#039;t trust user input, so filter everything that comes from the user

2) I made my own function for this (also not secure) but calls to it are really short. Handy if you have big forms with lots of variables. Your function would have to be called for every variable.

http://pastebin.com/f6297df11</description>
		<content:encoded><![CDATA[<p>1) remember safety, don&#8217;t trust user input, so filter everything that comes from the user</p>
<p>2) I made my own function for this (also not secure) but calls to it are really short. Handy if you have big forms with lots of variables. Your function would have to be called for every variable.</p>
<p><a href="http://pastebin.com/f6297df11" rel="nofollow">http://pastebin.com/f6297df11</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/comment-page-1/#comment-31585</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 17 Jun 2008 02:24:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nutt.net/archive/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/52.html#comment-31585</guid>
		<description>That&#039;s right, of course, and now that I see it written out it&#039;s pretty obvious.</description>
		<content:encoded><![CDATA[<p>That&#8217;s right, of course, and now that I see it written out it&#8217;s pretty obvious.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/comment-page-1/#comment-31582</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 17 Jun 2008 00:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nutt.net/archive/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/52.html#comment-31582</guid>
		<description>The diagnostic will be &quot;Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in&quot; followed by the file and line in which the call is attempted.  So you want &quot;else if (session_id() != “”) { if (array_key_exists($sVarName, $_SESSION) == TRUE) $temp = $_SESSION[$sVarName]; }&quot; in place of the simpler code.</description>
		<content:encoded><![CDATA[<p>The diagnostic will be &#8220;Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in&#8221; followed by the file and line in which the call is attempted.  So you want &#8220;else if (session_id() != “”) { if (array_key_exists($sVarName, $_SESSION) == TRUE) $temp = $_SESSION[$sVarName]; }&#8221; in place of the simpler code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/comment-page-1/#comment-31575</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 16 Jun 2008 18:49:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nutt.net/archive/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/52.html#comment-31575</guid>
		<description>You&#039;re right about $_COOKIE.  That&#039;s a typo, that I just fixed, from when I came back and added those lines.  

I don&#039;t think you need to check for a session.  If there&#039;s not an active session than the isset() will catch that the variable isn&#039;t set.  Of course I may be wrong.  What error would come up in case a session wasn&#039;t started?</description>
		<content:encoded><![CDATA[<p>You&#8217;re right about $_COOKIE.  That&#8217;s a typo, that I just fixed, from when I came back and added those lines.  </p>
<p>I don&#8217;t think you need to check for a session.  If there&#8217;s not an active session than the isset() will catch that the variable isn&#8217;t set.  Of course I may be wrong.  What error would come up in case a session wasn&#8217;t started?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.nutt.net/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/comment-page-1/#comment-31574</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 16 Jun 2008 17:34:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.nutt.net/archive/2004/12/27/a-quick-php-function-to-get-post-get-or-session-variables-and-cookies-too/52.html#comment-31574</guid>
		<description>There are a few things wrong with this code.  Line 28, instead of looking in $_COOKIE, attempts to call a function $_SESSION. (And $_SESSION is, of course, actually an array rather than a function.) And no check is made as to whether there is a session, which could result in a failure at line 22.</description>
		<content:encoded><![CDATA[<p>There are a few things wrong with this code.  Line 28, instead of looking in $_COOKIE, attempts to call a function $_SESSION. (And $_SESSION is, of course, actually an array rather than a function.) And no check is made as to whether there is a session, which could result in a failure at line 22.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

