Re: PHP adding / in front of apostrophes
by "Darrell King" <darrell(at)webctr.com>
|
Date: |
Thu, 5 Sep 2002 06:52:53 -0400 |
To: |
"HWG - Techniques" <hwg-techniques(at)hwg.org> |
References: |
megapathdsl |
|
todo: View
Thread,
Original
|
|
Backslashes are a normal part of PHP operations. In most installation, they
are added transparently to variable by PHP itself using Magic Quotes, thus
readying those variables for SQL queries.
In many installations, you can turn Magic Quotes on or off:
http://www.php.net/manual/en/function.set-magic-quotes-runtime.php
You can also add or strip quotes from a variable before displaying it. Tgis
is often unnecessary, but the need does rear it's head on occassion when
using form fields or email:
http://www.php.net/manual/en/function.stripslashes.php
http://www.php.net/manual/en/function.addslashes.php
There are many user comments involving real-world situations attached to
each of the function pages above. As always, it's very helpful if you
include and example of the code giving you a problem here so we can see if
our answers are on track or whether we misunderstood your problem...:).
D
----- Original Message -----
From: Scott Smith
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,
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA