Hi Philip, Thanks for taking the time...
$me = "confused"; ...but rather than attempting to get a grip on the past, I need a solution for the future :) So, 1. turn ON runtime and gpc 2. only addslashes() when inserting into the database IF get_magic_quotes_runtime() is 0 (false) 3. only stripslashes() when retrieving from the database IF get_magic_quotes_runtime() is 0 (false) Right so far? Then I need to know how to fix up possible mistakes in the past. What should I do to the current data in multiple tables which may or may not have had the addslashes() "done twice". Any one got some cool code??? Justin on 03/04/03 6:43 PM, Philip Olson ([EMAIL PROTECTED]) wrote: > On Thu, 3 Apr 2003, Justin French wrote: > >> Hi all, >> >> Can I just have a quick head check on magic quotes runtime (&gpc)? >> >> I have them both set to Off currently, and my pages work fine. However, >> when I set them to on, I end up with slashes throughout the mysql data. > > This means you essentially ran addslashes() twice before > insertion. Don't do that. You should never ever have to > strip slashes from data already in the database. > >> Is this the expected behaviour? Seems counter-intuitive to me, but I've >> never really cared about it 'till today, because i've never had a problem!! > > No, only add slashes once. Do this with a function like > addslashes() OR do it magically. Once. > >> What is a common setting for these two directives, so that I can have my LAN >> server *reasonably* "normal". > > Defaults to on so I guess that's "normal". See also > get_magic_quotes_gpc()... > > Regards, > Philip > > --- > [This E-mail scanned for viruses] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php