PHP Classes

File: examples/example4.php

Recommend this page to a friend!
  Classes of David Ferreira   Rex   examples/example4.php   Download  
File: examples/example4.php
Role: Example script
Content type: text/plain
Description: Example script on how to use Rex class
Class: Rex
Check proxy addresses and filter Javascript
Author: By
Last change: v1.1 update
Date: 16 years ago
Size: 400 bytes
 

Contents

Class file image Download
<?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;

// ...

?>