Page 1 of 1
add/strip slashes??
Posted: Sun Jun 23, 2002 4:50 pm
by ssand
I am using addslashes() when I insert data to mysql from a form and then stripslashes when I redisplay it in the browser.
Only problem is when an apostrophe is used. It seems php is adding an additional apostrophe. Is this so it has a set of single quotes or do I need to do something different?
Also, it looks like the information in the database has a single apostrophe.
Steve
Posted: Sun Jun 23, 2002 6:33 pm
by kaizix
if you echo out the info without using stripslashes first, does it still have the double single quote?
Posted: Sun Jun 23, 2002 6:58 pm
by ssand
I added the echo
without stripslashes and it produced the double single quote.
But, this time the echo
with stripslashes applied produced correct results!
Then, I clicked a different link and came back to the listing and it displayed 4 single qoutes for the unstripped and 2 for the stripped.

As I continued to click around it would sometimes display the first set of results then the last set of results.
What's with that?? The php info says magic_quotes_gpc is ON. Does that have some effect on this?
Steve
Update
Posted: Sun Jun 23, 2002 7:18 pm
by ssand
UPDATE
I ended up emptying the entire table and started with fresh data. Which for the time seems to be working.
Maybe I had some data from when I did not addslashes. Who knows?
Thanks for the help.