News Feed
Sections




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

Roshan Bhattarai's Blog:
How to filter user submitted data easily in PHP?
August 15, 2008 @ 09:31:59

On his blog, Roshan Bhattarai shares a few tips on keeping your application safe by filtering user-submitted data.

Yesterday, I saw one of my friend was working on the the contact form and was filtering the user input data(posted variables) individually. He was using a function in PHP to filter the input and using tedious approach while calling the filtering function for each variables with coding each of them in single line . Today, I'm going to show you how can you filter the posted variables easily using callback function in PHP.

He shows how to create a filter_data function (for removing HTML embedded in the data) and how to implement it around your data. It could be extended pretty easily to do more than one filtering method to protect your information even more.

0 comments voice your opinion now!
submit user data filter htmlentities


blog comments powered by Disqus

Similar Posts

MaltBlue.com: Zend Framework 2 Forms - Simple and Available Everywhere

Christian Stocker\'s Blog: PHPUG Zurich Meeting tomorrow

PHPWomen.org: Add values to a symfony form in between save() and serialization to the database

Kevin Schroeder's Blog: ZF2 Dependency Injection: Managing Configuration - Part 2

Lorna Mitchell's Blog: POSTing JSON Data With PHP cURL


Community Events

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


application testing project introduction language podcast example part2 interview laravel list composer series opinion yii2 api framework php7 community symfony

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