Hi peaps! Im here trying to resolve a VERY annoying problem, ive had this for days now and its been my most fustrating problem! what I need to do is replace "double quotes" in a form text area to 'single quotes'. The user types in some text in the text area and once submitted it goes into a database and the text then gets viewed on the main page. The text also gets called from the database into a hidden field on the main page. Thats were the problem is... if the user puts "" in his post then the post wont display properly. (type="hidden" value="$posttext"). I'd need to either add a slash to make \" or replace " to '. I've tried all kinds of different codes, some of my own and some of others. None of em worked.
create_post.php db query code:
// setup data to insert
$postDate = $formdata['postDate'];
$postSubject = $formdata['postSubject'];
$postedBy = $formdata['postedBy'];
$posttext = $formdata['posttext'];
I believe I have to put either addslashes or preg_replace in the post text db query string. Anyone got any suggestions in how to get it right??? thx.