note 58944 added to security.database.sql-injection
| From: | patofuofighter at yahoo dot com | Date: | Mon, 21 Nov 2005 18:00:15 +0000 |
| Subject: | note 58944 added to security.database.sql-injection | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98896@lists.php.net to get a copy of this message | ||
If you're expecting a number from user input, you can do:
$num = $_GET['num'] + 0;
this way, if the user set a string on num you'll get 0.
Works for a lot of cases.
----
Manual Page -- http://www.php.net/manual/en/security.database.sql-injection.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58944
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58944&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58944&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58944&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58944&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58944&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58944&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58944&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58944&report=yes
Search -- http://master.php.net/manage/user-notes.php