addslashes and magic_quotes_gpc

From: Date: Fri, 08 Dec 2000 13:16:59 +0000
Subject: addslashes and magic_quotes_gpc
Groups: php.general 
Request: Send a blank email to php-general+get-29339@lists.php.net to get a copy of this message
I'm seeing something that I don't understand - I have a form that accepts a string field, then I do a post, then call an INSERT routine which does "addslashes" to the field. I have magic_quotes_gpc "on" in the php.ini file. If field was originally entered as "Joe O'Brien", it ends up being inserted into the db as "Joe O\'Brien". But, if I comment out the "addslashes", it still ends up being inserted into the db as "Joe O\'Brien" - exactly the same. Why is this? I now understand that magic_quotes_gpc has automatically added the slash to the apostrophe in O'Brien, and I would have expected that the additional "addslashes" that I was doing would cause O\\'Brien, but it didn't. Can someone clarify 1. magic_quotes_gpc, AND 2. addslashes for me please! TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com

« previous php.general (#29339) next »