Help - Search - Members - Calendar
Full Version: Commas and quotes changing to \\\"
HTMLHelp Forums > Programming > Server-side Scripting
PsxMeUP
Hi, I have a site where commas and quotes change to \" once the article is posted (but only when it's written directly in the site's interface).

Some have proposed that it's because magic_quotes are set to on (and they are because I checked using <?php phpinfo(); ?>). I checked my php.ini file and it doesn't have that code, meaning it's probably set up on my hosting provider's side. So what are my options? Should I turn them off somehow (I read it might damage some of my code if I do)? Isn't it better to have them on? Is there something I can do to fix this problem? The site lets users post game reviews, and the last thing I want is a note saying "Warning, you must type your text in Word first," cause it would look lame, and I definitely want the site to be perfectly optimized.
Brian Chandler
I think the general view is that "magic quotes" are a lame attempt to bodge things, and it's better to turn them off, and check things properly yourself. You may be able to set your own php init file, depending on your host's instructions. Or you can turn them off at runtime:

http://jp2.php.net/manual/en/function.set-...tes-runtime.php

"Deprecated" means not that you shouldn't use this function to turn them off, but that they are a Bad Idea in the first place, as far as I know.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.