PHP Classes

Purifier: Get request variables and sanitize values

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 227 All time: 8,184 This week: 146Up
Version License PHP version Categories
purifier 1.0.0GNU General Publi...4.5PHP 5, Cryptography, Validation, Secu...
Description 

Author

This class can get request variables and sanitize values.

It can retrieve request variable values from either $_POST, $_GET or $_REQUEST.

The class can filter and sanitize the request values by either validating they they match expected type values and remove characters that are not expected.

The class can also generate hashes and verify values for passwords.

Picture of John Diaz
  Performance   Level  
Name: John Diaz <contact>
Classes: 3 packages by
Country: Colombia Colombia
Age: 41
All time rank: 289415 in Colombia Colombia
Week rank: 311 Up2 in Colombia Colombia Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php

include('Purifier.php');
$purifier = new Purifier;

$name = $purifier->getInputVar('name');

echo
'<br /><strong>Sanitized var:</strong> ' . $name ;
echo
'<br /><strong>Clean String:</strong> ' . $purifier->cleanString($name);
echo
'<br /><strong>Gen Secure Password:</strong> ' . $purifier->genSecurePassword(32);
echo
'<br /><strong>Gen Unique key:</strong> ' . $purifier->genKey(32);
$saltedPassword = $purifier->encryptPassword($name);
echo
"<br /><strong>Gen Hashed & Salted Password from '$name' :</strong>\n" .$saltedPassword ;
echo
'<br /><strong>Validate Salted Password:</strong> ';
var_dump($purifier->validatePassword($name, $saltedPassword));

?>
<hr />
<form action="example.php" method="post">
    <label>Name:</label> <input type="text" name="name" value="<?php echo $name ?>"/>
    <input type="submit" value="submit"/>
</form>


  Files folder image Files  
File Role Description
Plain text file Purifier.php Class Purifier Class
Accessible without login Plain text file example.php Example Example file of using Purifier class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:227
This week:0
All time:8,184
This week:146Up