PHP Classes

User Input Sanitation: Escape values of request variables

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 40%Total: 1,383 All time: 2,812 This week: 673Up
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

  Files folder image Files (2)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,383
This week:0
All time:2,812
This week:673Up
User Ratings User Comments (2)
 All time
Utility:56%StarStarStar
Consistency:56%StarStarStar
Documentation:-
Examples:62%StarStarStarStar
Tests:-
Videos:-
Overall:40%StarStarStar
Rank:3849
 
A little outdated, though not to bad in terms of formatting a...
14 years ago (Jason Hopkins)
57%StarStarStar
This is a poor class.
17 years ago (Nikolaj)
5%Star