Re: Kill Magic Quotes

From: Date: Fri, 08 Aug 2008 04:12:25 +0000
Subject: Re: Kill Magic Quotes
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-277869@lists.php.net to get a copy of this message
Dave M G wrote: >I am developing a web site that is hosted on a web server where I do not >have permission to change the php.ini file. > >This server has magic quotes turned on. I'd like them off. > >I wrote two functions to detect when magic quotes is on, and to try and >counter act its effects. But it does not seem to be working. It seems to >have no effect, and I get slashes showing up in all sorts of output >where I don't want them. Not only in data put into the database, but >also emails sent to from the site contact page and other places. Perhaps you also need to disable magic_quotes_runtime: set_magic_quotes_runtime(0); // just call it once per page Are you sure you actually call your removeSlashes() function? Why do you think you need your restoreSlashes() function? (NB: not sufficient for MySQL statements, and not applicable for some other databases) Roger Bigras wrote: >>you may try the >> >>ini_set('magic_quotes_gpc',0); That won't work: http://au.php.net/manual/en/function.get-magic-quotes-gpc.php "Keep in mind that the setting magic_quotes_gpc will not work at runtime." -- Ross McKay, Toronto, NSW Australia "Let the laddie play wi the knife - he'll learn" - The Wee Book of Calvin

« previous php.general (#277869) next »