[thelist] simple (?) php question

aboodman at youngpup.net aboodman at youngpup.net
Sat Aug 17 18:02:00 CDT 2002


This is probably the real problem. Your strings are getting double-escaped
on insert. When strings go into MySQL, single and double quotes only need
to be escaped with one backslash. You can do this manually, with
add_slashes( ), or, PHP can do it for you if you have a configuration
option called "magic quotes" turned on.

If you are getting output from the database that has quotes preceeded by
backslashes, that indicates that you are doing both. You should either turn
off magic quotes, or remove add_slashes() from your insert/update
statements. The first option is probably easier.

good luck,

Aaron Boodman
www.youngpup.net



Original Message:
-----------------
From: Nan Smith nansmith at heritageconcord.org
Date: Sat, 17 Aug 2002 07:23:15 -0400
To: thelist at lists.evolt.org
Subject: RE: [thelist] simple (?) php question


Duncan,
This part I am not quite sure of, but I think that your server has "magic
quotes" turned on, so that the slashes get added automatically. Otherwise
the db would have thrown error messages when the text was added to the
table.
If I have stated this incorrectly, can someone else please comment? There
was something on this recently, but I did not pay too much attention to
it because my server does not add the slashes, I have to use the
addslashes() function.
Nan

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Duncan O'Neill
Sent: Saturday, August 17, 2002 7:24 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] simple (?) php question


Nan Smith wrote:
> Duncan,
>
>
> $text_stored_in_db = stripslashes($text_stored_in_db);
>

Nan,

this appears to have fixed the problem. Thanks
very much. And yes, I'm the person who adds the
text to the db, so I'll take up your other
suggestion.

cheers,
--
=====================================================
Duncan O'Neill
"Smith The Reporter"
http://homepages.ihug.co.nz/~dbaxo/urban_legend.htm
=====================================================

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .





More information about the thelist mailing list