CodeCanyon - Simple Sanitize
Category: Plugins/Modules
- views: 4 525
- date: 15 August 2010
- posted by: SharePlus

CodeCanyon - Simple Sanitize
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.
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.
Demo:
http://codecanyon.net/item/simple-sanitize/full_screen_preview/114017
We need your support!
Make a donation to help us stay online
Bitcoin (BTC)
bc1q08g9d22cxkawsjlf8etuek2pc9n2a3hs4cdrld
Bitcoin Cash (BCH)
qqvwexzhvgauxq2apgc4j0ewvcak6hh6lsnzmvtkem
Ethereum (ETH)
0xb55513D2c91A6e3c497621644ec99e206CDaf239
Litecoin (LTC)
ltc1qt6g2trfv9tjs4qj68sqc4uf0ukvc9jpnsyt59u
USDT (ERC20)
0xb55513D2c91A6e3c497621644ec99e206CDaf239
USDT (TRC20)
TYdPNrz7v1P9riWBWZ317oBgJueheGjATm
Information |
|||
![]() |
Users of GUESTS are not allowed to comment this publication. | ||









