News Feed
Jobs Feed
Sections




News Archive
NETTUTS.com:
Sanitize and Validate Data with PHP Filters
January 16, 2009 @ 08:43:16

On the NETTUTS.com website today there's a new tutorial looking at a very important (but often forgotten) part of any good web application - sanitizing and filtering data.

Data validation is an integral part of working with forms. Not only can invalid submitted data lead to security problems, but it can also break your webpage. Today, we'll take a look at how to remove illegal characters and validate data by using the "filter_var" function.

Using filter_var they create a simple form with email and URL input fields. Their script runs these through the FILTER_SANITIZE_EMAIL and FILTER_SANITIZE_URL respectively to see if they are valid. Later they add on a name and message field to make it into an email form (performing the checks on these with the FILTER_SANITIZE_STRING).

A link to download the source is also included.

0 comments voice your opinion now!
sanitize filter viltervar string email url form tutorial


blog comments powered by Disqus

Similar Posts

Juozas Kaziukenas' Blog: Starting with Zend_Search_Lucene

IBM developerWorks: U2 PDO Driver Tutorial, Parts 1 & 2

Vidyut Luther's Blog: Adding Subscribers to Campaign Monitor Lists using PHP5 and SOAP

Henrik Bjørnskov's Blog: Symfony2: Add Cross Site Request Forgery protection to login forms

Scott MacVicar's Blog: Accessing pseudo random data with PHP


Community Events











Don't see your event here?
Let us know!


opinion application release code podcast series community functional zendframework2 conference phpunit tool interview example testing language framework unittest development introduction

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework