<?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: How to filter user submitted data easily in PHP?</title>
	<atom:link href="http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/feed" rel="self" type="application/rss+xml" />
	<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html</link>
	<description>Useful Tutorials, Scripts , Tips, and Resources for all PHP and Ajax beginners and experts .</description>
	<lastBuildDate>Mon, 07 May 2012 21:11:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jacob Poore</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-5211</link>
		<dc:creator>Jacob Poore</dc:creator>
		<pubDate>Sun, 28 Feb 2010 17:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-5211</guid>
		<description>learn something new everyday.  very cool</description>
		<content:encoded><![CDATA[<p>learn something new everyday.  very cool</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sell music beats</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-4912</link>
		<dc:creator>sell music beats</dc:creator>
		<pubDate>Wed, 16 Dec 2009 00:35:38 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-4912</guid>
		<description>This is good to know, i&#039;m always scared of people using certain characters in textfields to hack into my database, will be sure to filter everything carefully.</description>
		<content:encoded><![CDATA[<p>This is good to know, i&#8217;m always scared of people using certain characters in textfields to hack into my database, will be sure to filter everything carefully.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mello</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-4676</link>
		<dc:creator>mello</dc:creator>
		<pubDate>Sat, 10 Oct 2009 16:15:47 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-4676</guid>
		<description>I have a php site http://www.phloentertainment.com i might try this cool</description>
		<content:encoded><![CDATA[<p>I have a php site <a href="http://www.phloentertainment.com" rel="nofollow">http://www.phloentertainment.com</a> i might try this cool</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: beats</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-3532</link>
		<dc:creator>beats</dc:creator>
		<pubDate>Sat, 07 Feb 2009 03:10:53 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-3532</guid>
		<description>Learned something new with that array_map() function. I googled it and found other great examples.  Thanks for the post, just what I was looking for.</description>
		<content:encoded><![CDATA[<p>Learned something new with that array_map() function. I googled it and found other great examples.  Thanks for the post, just what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [??] Aug 23th 2008 - My Habari</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-3508</link>
		<dc:creator>[??] Aug 23th 2008 - My Habari</dc:creator>
		<pubDate>Thu, 29 Jan 2009 04:29:33 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-3508</guid>
		<description>[...] need for set/get methods in PythonjQuery JSON with PHP json_encode and json_decodeHow to filter user submitted data easily in PHP?twittex.com Launches!???? twittex.com ??? 6 ?????, ??? symfony, PHP, [...]</description>
		<content:encoded><![CDATA[<p>[...] need for set/get methods in PythonjQuery JSON with PHP json_encode and json_decodeHow to filter user submitted data easily in PHP?twittex.com Launches!???? twittex.com ??? 6 ?????, ??? symfony, PHP, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jay</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-3245</link>
		<dc:creator>jay</dc:creator>
		<pubDate>Tue, 02 Dec 2008 05:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-3245</guid>
		<description>In your example you have written a general function so that when a variable is required to be validated. you just call that function.

function filter_data($val)
{
  return htmlentities($val,ENT_QUOTES);
}

What if you want to replace that htmlentities with filter_input  ( ) can the input type parameter for this be POST?</description>
		<content:encoded><![CDATA[<p>In your example you have written a general function so that when a variable is required to be validated. you just call that function.</p>
<p>function filter_data($val)<br />
{<br />
  return htmlentities($val,ENT_QUOTES);<br />
}</p>
<p>What if you want to replace that htmlentities with filter_input  ( ) can the input type parameter for this be POST?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [??] Aug 23th 2008 &#171; Oceanic &#124; ????</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1987</link>
		<dc:creator>[??] Aug 23th 2008 &#171; Oceanic &#124; ????</dc:creator>
		<pubDate>Sat, 23 Aug 2008 09:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1987</guid>
		<description>[...] How to filter user submitted data easily in PHP? [...]</description>
		<content:encoded><![CDATA[<p>[...] How to filter user submitted data easily in PHP? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to filter user submitted data easily in PHP? &#124; coderchris.com</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1932</link>
		<dc:creator>How to filter user submitted data easily in PHP? &#124; coderchris.com</dc:creator>
		<pubDate>Mon, 18 Aug 2008 06:29:21 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1932</guid>
		<description>[...] How to filter user submitted data easily in PHP? [...]</description>
		<content:encoded><![CDATA[<p>[...] How to filter user submitted data easily in PHP? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roshan</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1918</link>
		<dc:creator>Roshan</dc:creator>
		<pubDate>Sun, 17 Aug 2008 05:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1918</guid>
		<description>@john - Thanks for your explanation
@Pierre - I can see still in some of of the web hosting company are using PHP4 and PHP 5.1.x , I&#039;m just worried for them only otherwise I&#039;m not against PHP&#039;s filter extension, I also recomment this if you&#039;re using PHP 5&gt;5.2.0.</description>
		<content:encoded><![CDATA[<p>@john &#8211; Thanks for your explanation<br />
@Pierre &#8211; I can see still in some of of the web hosting company are using PHP4 and PHP 5.1.x , I&#8217;m just worried for them only otherwise I&#8217;m not against PHP&#8217;s filter extension, I also recomment this if you&#8217;re using PHP 5>5.2.0.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1915</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Sat, 16 Aug 2008 21:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1915</guid>
		<description>PHP4 is dead, php 5.1.x has critical security issues, what is the reason to do not use php 5.2.x?</description>
		<content:encoded><![CDATA[<p>PHP4 is dead, php 5.1.x has critical security issues, what is the reason to do not use php 5.2.x?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John J.</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1904</link>
		<dc:creator>John J.</dc:creator>
		<pubDate>Fri, 15 Aug 2008 21:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1904</guid>
		<description>I couldn&#039;t echo Mojah&#039;s comment more strongly. The best practice when it comes to user input is to validate input (make sure it is the type/size you expect) and filter/encode/etc. output. You do the later ONLY when it is being output because you never know what the data will be used for between when it is input and when the script ends.

As for the filter extension, I recommend this as well. It is available as a pecl extension for those of you still stuck on PHP 5 &lt; 5.2 (if you are using PHP 4.x, WHY?!). You can use it to force a base level of security on all inputs and to get any user data you need to use the filter_input function.</description>
		<content:encoded><![CDATA[<p>I couldn&#8217;t echo Mojah&#8217;s comment more strongly. The best practice when it comes to user input is to validate input (make sure it is the type/size you expect) and filter/encode/etc. output. You do the later ONLY when it is being output because you never know what the data will be used for between when it is input and when the script ends.</p>
<p>As for the filter extension, I recommend this as well. It is available as a pecl extension for those of you still stuck on PHP 5 &lt; 5.2 (if you are using PHP 4.x, WHY?!). You can use it to force a base level of security on all inputs and to get any user data you need to use the filter_input function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roshan</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1896</link>
		<dc:creator>Roshan</dc:creator>
		<pubDate>Fri, 15 Aug 2008 16:50:43 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1896</guid>
		<description>@gerard - Thanks for the link of inspekt it seems to be a nice tool..will check it later in free time
@Pierre - Thanks but you must have PHP greater than 5.2.0 and not useful for people who are using lower version of PHP.</description>
		<content:encoded><![CDATA[<p>@gerard &#8211; Thanks for the link of inspekt it seems to be a nice tool..will check it later in free time<br />
@Pierre &#8211; Thanks but you must have PHP greater than 5.2.0 and not useful for people who are using lower version of PHP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1895</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Fri, 15 Aug 2008 15:43:23 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1895</guid>
		<description>Ever heard of http://www.php.net/filter ?</description>
		<content:encoded><![CDATA[<p>Ever heard of <a href="http://www.php.net/filter" rel="nofollow">http://www.php.net/filter</a> ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gerard</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1894</link>
		<dc:creator>gerard</dc:creator>
		<pubDate>Fri, 15 Aug 2008 15:40:50 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1894</guid>
		<description>Have you checked out Inspekt (http://inspekt.org)? It wraps a &quot;cage&quot; around your input data and can make input filtering transparently easy.</description>
		<content:encoded><![CDATA[<p>Have you checked out Inspekt (<a href="http://inspekt.org" rel="nofollow">http://inspekt.org</a>)? It wraps a &#8220;cage&#8221; around your input data and can make input filtering transparently easy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://roshanbh.com.np/2008/08/how-to-filter-user-submitted-data-easily-in-php.html/comment-page-1#comment-1879</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Thu, 14 Aug 2008 18:01:18 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=217#comment-1879</guid>
		<description>@Roshan

Noooo!  Don&#039;t encourage people to use extract() on $_POST or any other user input superglobal for that matter!  That&#039;s precisely the problem with register_globals.

If you extract() all of the variables in an input array, you open up the very real possibility that an internal variable that you didn&#039;t intend for users to interact with can now be initialized with anything the user wants.

They could for example, post a variable called content and fill it with javascript.  If you happen to use a variable $called content in your code and don&#039;t initialize it with an empty string before concatenating to it, that javascript may be passed back out to the page when you echo $content.</description>
		<content:encoded><![CDATA[<p>@Roshan</p>
<p>Noooo!  Don&#8217;t encourage people to use extract() on $_POST or any other user input superglobal for that matter!  That&#8217;s precisely the problem with register_globals.</p>
<p>If you extract() all of the variables in an input array, you open up the very real possibility that an internal variable that you didn&#8217;t intend for users to interact with can now be initialized with anything the user wants.</p>
<p>They could for example, post a variable called content and fill it with javascript.  If you happen to use a variable $called content in your code and don&#8217;t initialize it with an empty string before concatenating to it, that javascript may be passed back out to the page when you echo $content.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/19 queries in 0.034 seconds using disk: basic
Object Caching 408/408 objects using disk: basic

Served from: roshanbh.com.np @ 2012-05-21 18:46:21 -->
