<?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: Form Validation Class using PHP 5.3</title>
	<atom:link href="http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/</link>
	<description>Web devlopment and life in general</description>
	<lastBuildDate>Thu, 01 Dec 2011 06:51:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Brett</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-3934</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Wed, 09 Nov 2011 16:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-3934</guid>
		<description>The code I posted here is purely for validating form input data. No, it does not protect from SQL injection attacks. The PHP manual has some suggestions for &lt;a href=&quot;http://php.net/manual/en/security.database.sql-injection.php&quot; rel=&quot;nofollow&quot;&gt;avoiding SQL Injections&lt;/a&gt;. Personally, I like to use &lt;a href=&quot;http://us3.php.net/manual/en/pdostatement.bindvalue.php&quot; rel=&quot;nofollow&quot;&gt;PDO prepared statements with named place holders&lt;/a&gt;. You can use this class to add a callback function or a new inline function to test that your data is valid before actually inserting in your database (which is one of the several purposes of form validation anyway.)</description>
		<content:encoded><![CDATA[<p>The code I posted here is purely for validating form input data. No, it does not protect from SQL injection attacks. The PHP manual has some suggestions for <a href="http://php.net/manual/en/security.database.sql-injection.php" rel="nofollow">avoiding SQL Injections</a>. Personally, I like to use <a href="http://us3.php.net/manual/en/pdostatement.bindvalue.php" rel="nofollow">PDO prepared statements with named place holders</a>. You can use this class to add a callback function or a new inline function to test that your data is valid before actually inserting in your database (which is one of the several purposes of form validation anyway.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-3931</link>
		<dc:creator>Leon</dc:creator>
		<pubDate>Wed, 09 Nov 2011 08:17:59 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-3931</guid>
		<description>The validator also protects against sql injections?</description>
		<content:encoded><![CDATA[<p>The validator also protects against sql injections?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1507</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Sat, 29 Jan 2011 15:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1507</guid>
		<description>Tasos,

Thanks for the additional rules that you have added to the FormValidator class on github, per my request.

Tasos has added the following rule validations...

startsWith
notstartsWith
endsWith
notendsWith

Thanks again.</description>
		<content:encoded><![CDATA[<p>Tasos,</p>
<p>Thanks for the additional rules that you have added to the FormValidator class on github, per my request.</p>
<p>Tasos has added the following rule validations&#8230;</p>
<p>startsWith<br />
notstartsWith<br />
endsWith<br />
notendsWith</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tasos Bekos</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1361</link>
		<dc:creator>Tasos Bekos</dc:creator>
		<pubDate>Mon, 10 Jan 2011 09:45:25 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1361</guid>
		<description>Hello again Brett.

I have made some changes to your work and published it on github.

I have added rules (basically date validation), moved default error messages into separate function to make it easier for i18n and tried to minimize script warnings.

I implemented the arguments private array in order to leave your caching method untouched.

See: https://github.com/bekos/php-validation and if it&#039;s OK with you you can publish it.</description>
		<content:encoded><![CDATA[<p>Hello again Brett.</p>
<p>I have made some changes to your work and published it on github.</p>
<p>I have added rules (basically date validation), moved default error messages into separate function to make it easier for i18n and tried to minimize script warnings.</p>
<p>I implemented the arguments private array in order to leave your caching method untouched.</p>
<p>See: <a href="https://github.com/bekos/php-validation" rel="nofollow">https://github.com/bekos/php-validation</a> and if it&#8217;s OK with you you can publish it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1348</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Thu, 06 Jan 2011 18:54:51 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1348</guid>
		<description>Thanks Tasos. That was a function caching algorithm I wrote in later. Really not necessary and didn&#039;t really save me on resources since I compiled and sent the function anyway. It was working for closures where the use keyword was not in effect because the parameter for the closure was always the current POST value, however, there seems to be no obvious way to determine if the &quot;use&quot; variables were different. I thought about adding a boolean parameter toggle function caching for set_rules() but it just didn&#039;t seem feasible (unless I check for the cached function in the public functions themselves, but again little gain for a unnecessary feature.) 

Thanks again. I will be updating the source code shortly.

I &lt;strong&gt;might&lt;/strong&gt; implement the args private array as you suggested later on. For now, &lt;a href=&quot;https://github.com/bretticus/PHP-5.3-Form-Validator&quot; rel=&quot;nofollow&quot;&gt;feel free to fork the project at github&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Thanks Tasos. That was a function caching algorithm I wrote in later. Really not necessary and didn&#8217;t really save me on resources since I compiled and sent the function anyway. It was working for closures where the use keyword was not in effect because the parameter for the closure was always the current POST value, however, there seems to be no obvious way to determine if the &#8220;use&#8221; variables were different. I thought about adding a boolean parameter toggle function caching for set_rules() but it just didn&#8217;t seem feasible (unless I check for the cached function in the public functions themselves, but again little gain for a unnecessary feature.) </p>
<p>Thanks again. I will be updating the source code shortly.</p>
<p>I <strong>might</strong> implement the args private array as you suggested later on. For now, <a href="https://github.com/bretticus/PHP-5.3-Form-Validator" rel="nofollow">feel free to fork the project at github</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1345</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Thu, 06 Jan 2011 14:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1345</guid>
		<description>Thanks for the information Tasos. 

Can you post an example of how you are validating the fields? Once the validation method is called, the rules array is reset. Not sure why you are having that issue, but then again, I haven&#039;t used this validation class in production much yet.</description>
		<content:encoded><![CDATA[<p>Thanks for the information Tasos. </p>
<p>Can you post an example of how you are validating the fields? Once the validation method is called, the rules array is reset. Not sure why you are having that issue, but then again, I haven&#8217;t used this validation class in production much yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tasos Bekos</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1344</link>
		<dc:creator>Tasos Bekos</dc:creator>
		<pubDate>Thu, 06 Jan 2011 09:05:10 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1344</guid>
		<description>...continue...

I think bug is on line 273 where the new function for the 2nd field is not set because already exists, but with the older aruments.

You can probably remove this check, or better create a private arguments array to be always set and called with validate.</description>
		<content:encoded><![CDATA[<p>&#8230;continue&#8230;</p>
<p>I think bug is on line 273 where the new function for the 2nd field is not set because already exists, but with the older aruments.</p>
<p>You can probably remove this check, or better create a private arguments array to be always set and called with validate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tasos Bekos</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1343</link>
		<dc:creator>Tasos Bekos</dc:creator>
		<pubDate>Thu, 06 Jan 2011 08:35:49 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1343</guid>
		<description>Good script but I think there is a bug, about scope.

To reproduce it you can validate 2 different fields for minlength 5 (the 1st) and 2 (the 2nd).
Scope problem validates both fields for minimum length of 5.

Can you confirm this bug?
Thx</description>
		<content:encoded><![CDATA[<p>Good script but I think there is a bug, about scope.</p>
<p>To reproduce it you can validate 2 different fields for minlength 5 (the 1st) and 2 (the 2nd).<br />
Scope problem validates both fields for minimum length of 5.</p>
<p>Can you confirm this bug?<br />
Thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1310</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Sat, 01 Jan 2011 20:36:53 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1310</guid>
		<description>Personally, I prefer not to nag the user about more than one validation failure per field. 1) Because most users are non-technical and it&#039;s better to keep instructions simple and 2) users rarely make multiple validation mistakes on the same field. If you require all messages being reported, it shouldn&#039;t take too much effort to re-factor the validate() method. Feel free to &lt;a href=&quot;https://github.com/bretticus/PHP-5.3-Form-Validator&quot; rel=&quot;nofollow&quot;&gt;fork the library at github&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Personally, I prefer not to nag the user about more than one validation failure per field. 1) Because most users are non-technical and it&#8217;s better to keep instructions simple and 2) users rarely make multiple validation mistakes on the same field. If you require all messages being reported, it shouldn&#8217;t take too much effort to re-factor the validate() method. Feel free to <a href="https://github.com/bretticus/PHP-5.3-Form-Validator" rel="nofollow">fork the library at github</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: moto0000</title>
		<link>http://brettic.us/2010/06/18/form-validation-class-using-php-5-3/comment-page-1/#comment-1280</link>
		<dc:creator>moto0000</dc:creator>
		<pubDate>Thu, 30 Dec 2010 15:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://brettic.us/?p=312#comment-1280</guid>
		<description>How to make class pay all the mistakes and not just the first?</description>
		<content:encoded><![CDATA[<p>How to make class pay all the mistakes and not just the first?</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 (User agent is rejected)
Database Caching 4/25 queries in 0.034 seconds using memcached

Served from: brettic.us @ 2012-05-20 01:07:13 -->
