NamePros.Com (http://www.namepros.com/)
-   CODE (http://www.namepros.com/code/)
-   -   Clean Input (http://www.namepros.com/code/404816-clean-input.html)

RegisterRants 12-08-2007 07:45 PM

Clean Input
 
These are some code snippets for use in cleaning input. Please note that these are NOT the complete security solution; for best results, you should use Whitelist-based authentication.

For AJAX requests:

Code:
foreach ($_POST as $key => $value) $_POST[$key]=trim(strip_tags(urldecode($value)));


For standard forms:

Code:
foreach ($_POST as $key => $value) $_POST[$key]=trim(strip_tags($value));


Jason


All times are GMT -7. The time now is 05:43 AM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0