PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Evert Ulises German Soto   Anti XSS Atacks   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: How to use anti xss class
Class: Anti XSS Atacks
Clean request values to avoid security attacks
Author: By
Last change:
Date: 9 years ago
Size: 889 bytes
 

Contents

Class file image Download
<?php
//First of all, must be include the file class
require("antixss.class.php");

//Creating instance
$xss = new wArLeY_AntiXSS();

//If you need clean your $_GET array you cant test something like this
foreach($_GET AS $key=>$value){
    echo
"<div style='border:1px solid #FE0000;margin-top:5px;'>". $xss->clean($_GET[$key], array('prevent_basic_xss', 'filter_sanitize')) ."</div>";
}

/*
Note:
    The unique method "clean" in the class need 2 params
    1.- The STRING that you need clean
    2.- An array with the clean methods, the methods are execute in the relative order provided.
   
    Existant methods:
    * prevent_basic_xss
    * html_special_character
    * stripe_tags
    * stripe_slashes
    * filter_sanitize
    * filter_email
    * rare_accent
    * special_character
    * allowed_by_os

    The array can content one or more methods to execute.
   
    Protect you and enjoy!
*/
?>