note 25010 added to function.strip-tags
| From: | php-post at progexp dot com | Date: | Sat, 07 Sep 2002 18:56:13 +0000 |
| Subject: | note 25010 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36309@lists.php.net to get a copy of this message | ||
Here's a quick way to protect all your incoming values against cross-site scripting attacks by
removing HTML tags:
foreach (array_merge (
$_POST, $_GET) as $k=>
$v) {eval('$'.$k.'="'.
strip_tags($v).'";');}
You could modify this to include cookie and session values as needed.
--
http://www.php.net/manual/en/function.strip-tags.php
http://master.php.net/manage/user-notes.php?action=edit+25010
http://master.php.net/manage/user-notes.php?action=delete+25010
http://master.php.net/manage/user-notes.php?action=reject+25010