You're fault. :)
Remember that quotes are used to tell the beginning and end of a string. So
if you are using a " to mean the beginning of the string, then there can't
be any " within the string itself. If there are any ", they need to be
changed to \", which means they are escaped.
magic_quotes_gpc = ON does this automatically for you when you submit values
through GET, POST, or COOKIE. You can also use the addslashes() function.
Your errors are all related to this issue.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 27, 2002 4:59 PM
Subject: [PHP] Newbie problem - Slashes
> Hello all,
> I'm a newbie into PHP and am facing a funny problem.
> I have a form with a textarea named address,
> I am able to submit the form and enter the data into the database without
any problem,but to make sure that it handles "bad" data too I tested it out
with this sentance:
> When cheese gets it's picture taken, what does it say?
> then "previewed" it and the output was, (note the slash )
> When cheese gets it\'s picture taken, what does it say?
> (even entered into the database without a problem)
> so I further tested it with: (note the " instead of the ')
> When cheese gets it"s picture taken, what does it say?
> and the output was:
> When cheese gets it\"s picture taken, what does it say?
> but when I looked in the database it only showed
> When cheese gets it\
> any idea what the problem is? is it my fault or PHP's or MySql's?
> sorry if its a bit confusing, if need be I can send you all the 3 files
i'm using and the table structure, kindly help.
> - Kim.
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php