note 58784 added to function.strstr
| From: | nospamATthenerdshow dot com at osu1 dot php dot net | Date: | Wed, 16 Nov 2005 00:20:22 +0000 |
| Subject: | note 58784 added to function.strstr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98631@lists.php.net to get a copy of this message | ||
It is a good practice to ensure dropdown menu submissions contain ONLY expected values:
$i=(isset($_POST['D1']))?$_POST['D1']:$o="Monday";
if (!stristr('Monday Tuesday Wednesday Thursday Friday Saturday Sunday',$i)) die();
(do database query)
This should protect against all known and unknown attacks, injection, etc.
User submitted should be cleaned through other functions. See info under mysql_query
----
Manual Page -- http://www.php.net/manual/en/function.strstr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58784
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58784&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58784&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58784&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58784&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58784&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58784&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58784&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58784&report=yes
Search -- http://master.php.net/manage/user-notes.php