Page 1 of 1

Replacing single quotes from text box to db

Posted: Tue Jan 27, 2009 3:14 pm
by odie2828
I have a form that you can enter a subject and then a story.

if you enter anything in the text boxes that has a single quote, when it posts that info from the db it puts a slash infront of it.

Anyone know how to fix?

Re: Replacing single quotes from text box to db

Posted: Tue Jan 27, 2009 3:53 pm
by VladSun
Take a look at
mysql_real_escape_string() - before inserting into DB.
stripslashes() - when outputing to HTML.

Re: Replacing single quotes from text box to db

Posted: Wed Jan 28, 2009 11:52 am
by odie2828
Thank you very much!