News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

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

SitePoint PHP Blog: Effective PDF Generation in Drupal

NETTUTS.com: Using htaccess Files for Pretty URLS

PHPMaster.com: WordPress Plugin Development

Pádraic Brady's Blog: The Factory and Abstract Factory patterns in PHP

Matthew Weier O'Phinney: RESTful APIs with ZF2, Part 2


Community Events

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


release podcast laravel composer symfony2 application extension example community api introduction opinion version interview install php7 library performance series framework

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