WorldWideScripts.net Delivering the best Add-Ons in more than 37 languages.

中文(简体), English, हिन्दी/हिंदी, Español/Castellano, العربية, Русский язык, Français, 中文 (台灣), বাংলা, Bahasa Indonesia, اردو, Português, Deutsch, Bahasa Melayu (بهاس ملايو‎), 日本語 (にほんご), فارسی, Italiano, తెలుగు, Türkçe, ગુજરાતી, Język polski/polszczyzna, Tiếng Việt, ಕನ್ನಡ, Українська мова, ไทย
PHP Scripts / Miscellaneous

Simple Sanitize

— Add-On to WorldWideScripts.net

Subscribe to our feed to stay up to date!

New! Follow us as you want it!


Simple Sanitize - CodeCanyon Item for Sale

Ads

Ad: Bluehost hosting

Use this PHP Class to safely access user input like GET and POST variables. Set it and forget it! This class automatically sanitizes your data in various ways. Current options include “strict”, “html”, “mysql”, “both” (html and mysql), or “none”.

Each sanitizing level handles data a little bit differently. “strict” will return input with only alphanumeric characters. “html” encodes all html-entites. “mysql” escapes all special mysql characters (no mysql connection required). “both” runs the html sanitizing and then the mysql. “none” will give you the data as it is.

Optional maxlength parameters included! Before you sanitize a string, you can define the max length (for strings) or max value (for numbers). Strings will be cut off at the maxlength before it is sanitized, and numbers won’t be allowed past that value.

Arrays are supported! This class will recursively sanitize any array it runs into. That means you can return the entire $_POST variable with each and every value sanitized the way you want it.

Force data types! You can force any value you retrieve to be an int, float, or boolean.


Download
Other components in this categoryAll components of this author
CommentsFrequently asked questions and answers

Properties

Created:
4 August 10

Last Update:
4 August 10

High Resolution:
No

Files Included:
PHP

Software Version:
PHP 4.x, PHP 5.x, PHP 5.0 - 5.2, PHP 5.3, MySQL 4.x, MySQL 5.x

Keywords

eCommerce, eCommerce, All Items, clean, data, easy, input, safe, sanitize, security, simple, user, xss