Addslashes
| From: | root | Date: | Wed, 15 Dec 1999 10:05:22 +0000 |
| Subject: | Addslashes | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7945@lists.php.net to get a copy of this message | ||
Guys, i think i hit a bug in the php-4b3 release. Ive got a script that
saves a text field from a entry form (<textarea>) into a DB field (mysql
mediumtext). On submission i do a
$text = addslashes($text);
to prevent SQL errors. When i save this 'string', and edit the content
again it has still got \'s in the text. Eg
begin text : i'm curious how this will work
text after addslashes (so send to the DB) : i\\\'m curious
text when querying/displaying string: i\'m curious
So it seems the addslashes function is a little escape happy in php-4b3.
Ps this behaviour isnt present in the php-3 series, and is new under
php-4b's ...
Hope this helps
-- Chris Chabot