RE: [PHP] Bizarre Quotes Behavior
| From: | Philip Olson | Date: | Fri, 11 Apr 2003 15:03:21 +0000 |
| Subject: | RE: [PHP] Bizarre Quotes Behavior | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143514@lists.php.net to get a copy of this message | ||
> > > > What's your magic_quotes_sybase directive set to? I
> > > > am guessing it along with magic_quotes_gpc is on and
> > > > that you also addslashes() data before inserting
> > > > into the database. So, you escape ' twice.
> > >
> > > You are right about that on both counts. If so, is there a workaround?
> > >
> > > If I have to turn off magic quotes, can I do that without having to
> > > recompile PHP?
> >
> > No. manual > ini_set().
> >
>
> Well, that's cool. :)
Not _that_ cool because you cannot set magic_quotes_gpc
at runtime (i.e. ini_set() will not work here).
You can use php.ini though, or .htaccess, or only run
addslashes() if get_magic_quotes_gpc() is false or
whatever... :) See, magic quotes is a huge topic
in the PHP world and no simple solution exists. It
makes writing scripts for the masses a little more
difficult although it existing and being on by default
also means less support questions as SQL queries will
"magically" work and as a whole be more secure.
Regards,
Philip