Overcome XSS scripting or cross site scripting 17Feb, 2011

Just paste this code in a header file which is included in the site. You can exclude the fields like description while filtering the POST And GET.

foreach ($_GET as $key => $value) {
$_GET[$key] = strip_tags($value);
}

foreach ($_POST as $key => $value) {
$_POST[$key] = strip_tags($value);
}

foreach ($_SERVER as $key => $value) {
$_SERVER[$key] = strip_tags($value);
}
Posted by: Behnish Mann / In: PHP
Cam