PHP Classes

File: usage_filter_class.txt

Recommend this page to a friend!
  Classes of Kumar Saurabh Sinha  >  Filter Class  >  usage_filter_class.txt  >  Download  
File: usage_filter_class.txt
Role: Documentation
Content type: text/plain
Description: Readme for Filterclass
Class: Filter Class
Filter to prevent XSS, SQL injection, CSRF attacks
Author: By
Last change: changed object creation
Date: 2 years ago
Size: 712 bytes


Class file image Download
Usage for FilterClass

1. For Filtering a Single value

	$objString = FilterClass::prepareDataObject($valueToFilter, $filterArray);
	$finalValue = FilterClass::filterDataValue($objString);
	In Above
	a. $valueToFilter: Teh value which can to be filtered
	b. $filterArray: operation to be performed on the string
					eg: $filterArray = array('strip_tags' => array(), 'addslashes' => array());
2. For Filtering the complte array
	$resultArray = FilterClass::filterXSS($arrayToFilter);
	In Above: 
	$arrayToFilter: This is the array to be filtered ($_POST, $_GET, $_REQUEST, or any array with values);
	Note: This is only to filter XSS