note 38628 added to function.str-replace
| From: | DanKeeling at rn2 dot php dot net | Date: | Tue, 30 Dec 2003 21:39:49 +0000 |
| Subject: | note 38628 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62697@lists.php.net to get a copy of this message | ||
I know there are enough examples here, but I would like to add mine:
When sending input into mysql SP or query, there are problems with the user enters: ' or "
simple enogh fix
function removequerychars($querysting)
{
$replace_chars = array("'", '"');
$replace_with = array("", "");
return( str_replace($replace_chars, $replace_with, $querysting) ) ;
}
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38628
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38628&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38628&report=yes
Search -- http://master.php.net/manage/user-notes.php