// Фильтр всех входяих данных
if (isset($_POST)) foreach ($_POST as $key => $value) $_POST[$key] = htmlspecialchars(stripslashes(trim($value)));
if (isset($_GET)) foreach ($_GET as $key => $value) $_GET[$key] = htmlspecialchars(stripslashes(trim($value)));
if (isset($_SESSION)) foreach ($_SESSION as $key => $value) $_SESSION[$key] = htmlspecialchars(stripslashes(trim($value)));
if (isset($_COOKIE)) foreach ($_COOKIE as $key => $value) $_COOKIE[$key] = htmlspecialchars(stripslashes(trim($value)));