PHP Classes

User Input Sanitation: Escape values of request variables

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2007-12-07 (7 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,362 All time: 2,718 This week: 1,020Up
Version License PHP version Categories  
sanitize 1.0GNU General Publi...3.0HTTP, Text processing
Description Author  

This class can be used to escape values of request variables.

It traverses the arrays of request super-global variables $_GET, $_POST, $_REQUEST and $_COOKIE.

The class escapes the values of the request variables add escape slashes characters to quotes, backslashes and NUL characters, so the values can be used in database queries without further escaping.

As I have closely watched PHPClasses for a long time now, I must say that I never saw a class which is simple yet very effective in sanitizing user input which is a major security concern for every web application. I have used simple logic and methods to clean malicious input and make database interaction a bit safer.

Picture of nirmit
Name: nirmit <contact>
Classes: 1 package by
Country: India India
Age: ???
All time rank: 1836115 in India India
Week rank: 1609 Up113 in India India Up

  Files folder image Files  
File Role Description
Plain text file class.sanitize.php Class This is the class file which does all the sanitation work.
Accessible without login Plain text file example.php Example This is a working example of the class

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,362All time:2,718
 This week:0This week:1,020Up
 User Comments (2)