<?php
error_reporting(E_ALL);
function anti_hacker($txt){
$txt=str_replace("|","I",$txt); 
$txt=str_replace("../",",,/",$txt);
$txt=str_replace("||","I",$txt);
$txt=htmlspecialchars($txt);                  
$txt=str_replace("\"","&#34;",$txt);
$txt=str_replace("/\\\$/","&#36;",$txt);
$txt=str_replace("$","&#36;",$txt);          
$txt=str_replace("\\","&#92;",$txt);
$txt=str_replace("@","&#64;",$txt);
$txt=str_replace("`","",$txt);  
$txt=str_replace("^","",$txt);
$txt=str_replace("%","&#37;",$txt);
$txt=stripslashes(trim($txt));
return $txt;}

if(isset($_GET)){foreach($_GET as $key=>$value){$_GET[$key]=anti_hacker($value);}}
if(isset($_POST)){foreach($_POST as $key=>$value){$_POST[$key]=anti_hacker($value);}}
if(isset($_SESSION)){foreach($_SESSION as $key=>$value){$_SESSION[$key]=anti_hacker($value);}}
if(isset($_COOKIE)){foreach($_COOKIE as $key=>$value){$_COOKIE[$key]=anti_hacker($value);}}
?>