Re: PHP adding / in front of apostrophes
by "Paul Roberts" <hwg(at)roberts200025.freeserve.co.uk>
|
Date: |
Thu, 5 Sep 2002 19:06:59 +0100 |
To: |
"Scott Smith" <wahikan(at)megapathdsl.net>, "HWG - Techniques" <hwg-techniques(at)hwg.org> |
References: |
megapathdsl |
|
todo: View
Thread,
Original
|
|
there are 2 ways this is controlled,
magic_quotes_gpc boolean=20
Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When =
magic_quotes are on, all ' (single-quote), " (double quote), \ =
(backslash) and NUL's are escaped with a backslash automatically. If =
magic_quotes_sybase is also on, a single-quote is escaped with a =
single-quote instead of a backslash.=20
magic_quotes_runtime boolean=20
If magic_quotes_runtime is enabled, most functions that return data from =
any sort of external source including databases and text files will have =
quotes escaped with a backslash. If magic_quotes_sybase is also on, a =
single-quote is escaped with a single-quote instead of a backslash.
you can look in php.ini or use phpinfo() in a php file to get the server =
set-up.
if you don't want your database output escaped automatically then set =
magic_quotes_runtime to off or use stripslashes($string) to remove the =
slashes before outputting them.
If your apostrophises are inserted as \' then only the ' will be stored =
in the db as it is escaped.
Paul Roberts
http://www.paul-roberts.com
mail(at)paul-roberts.com
++++++++++++++++++++++++
----- Original Message -----=20
From: "Scott Smith" <wahikan(at)megapathdsl.net>
To: "HWG - Techniques" <hwg-techniques(at)hwg.org>
Sent: Thursday, September 05, 2002 3:56 AM
Subject: FW: PHP adding / in front of apostrophes
Hi Christie,
\r\n (return\new, for carriage return and new line) are common =
instructions
in many C like languages. A / (slash) may be used to tell the program =
that
the next character in the string is a literal one. The ' (apostrophe) is
often used to begin and terminate a sting, or may be part of the syntax =
in a
function. I don't know PHP either, or where exactly you are entering =
your
text, but it may be telling you that you need a / before the ' in your =
code
:-)
Someone please clean up after me and explain this properly,
Regards,
Scott Smith
mailto:scott(at)wahikan.com
Wahikan iServices
networks, systems, eConsulting
http://www.wahikan.com/
-----Original Message-----
From: owner-hwg-techniques(at)hwg.org
[mailto:owner-hwg-techniques(at)hwg.org]On Behalf Of Christie Cooksey
Sent: Wednesday, September 04, 2002 5:58 PM
To: HWG - Techniques
Subject: PHP adding / in front of apostrophes
I'm entering text for a php/mysql site and no matter what I do I get:
master/'s
women/'s
I don't know anything about php but it looks like it's only adding the /
after n's and r's.
Right now I'm using ´ because it looks better than /' but...
Is there a code I can use for the apostrophe???
Cheers
Christie Cooksey :0)
http://www.thearmidalemall.com
http://www.designedbychristie.com
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA