<?php
if(count($_GET) > 0)
{
foreach($_GET as $key => $value)
{
$value = strip_tags($value);
$value = htmlspecialchars($value);
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
$value = trim($value);
$value = str_replace("<", "<", $value);
$value = str_replace(">", ">", $value);
if(get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
$value = mysql_real_escape_string($value);
$_GET[$key] = $value;
}
}
if(count($_POST) > 0)
{
foreach($_POST as $key => $value)
{
$value = strip_tags($value);
$value = htmlspecialchars($value);
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
$value = trim($value);
$value = str_replace("<", "<", $value);
$value = str_replace(">", ">", $value);
if(get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
$value = mysql_real_escape_string($value);
$_POST[$key] = $value;
}
}
if(count($_COOKIE) > 0)
{
foreach($_COOKIE as $key => $value)
{
$value = strip_tags($value);
$value = htmlspecialchars($value);
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
$value = trim($value);
$value = str_replace("<", "<", $value);
$value = str_replace(">", ">", $value);
if(get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
$value = mysql_real_escape_string($value);
$_COOKIE[$key] = $value;
}
}
if(count($_SESSION) > 0)
{
foreach($_SESSION as $key => $value)
{
$value = strip_tags($value);
$value = htmlspecialchars($value);
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
$value = trim($value);
$value = str_replace("<", "<", $value);
$value = str_replace(">", ">", $value);
if(get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
$value = mysql_real_escape_string($value);
$_SESSION[$key] = $value;
}
}
?>