<?php
 
// example4 php showing Rex class in action
 
 
// ...
 
require ("rex.class.php");
 
$rex = new rex();
 
 
$var = "<h1>Test</h1>";
 
 
// Filter for possible XSS attacks
 
$a = $rex->filterxss($var, 1);
 
 
// prints <h1>Test</h1> but not executing the HTML
 
echo $a;
 
 
// Filter for possible XSS attacks
 
$b = $rex->filterxss($var, 0);
 
 
// prints Test removing the tags
 
echo $b;
 
 
// ...
 
 
?>
 
 |