brem13 Posted April 1, 2009 Share Posted April 1, 2009 hey, when i type into a textbox or text area and there are single quotes ( ' ) used, i get errors for sql, i use htmlspecialchars, how can i fix this. here is the code from the form **************************** <textarea name="bboard" style="font-size:11px; font-family:Tahoma; width: 225px; height: 60px" rows="1" cols="20"></textarea><br /> here is the code that gets the post ******************************** $comment = htmlspecialchars(Trim(stripslashes($_POST['bboard']))); Link to comment https://forums.phpfreaks.com/topic/152126-quotes-causing-errors/ Share on other sites More sharing options...
timmah1 Posted April 1, 2009 Share Posted April 1, 2009 Have you tried mysql_real_escape_string() Link to comment https://forums.phpfreaks.com/topic/152126-quotes-causing-errors/#findComment-798957 Share on other sites More sharing options...
PFMaBiSmAd Posted April 1, 2009 Share Posted April 1, 2009 Read the php manual section for htmlspecialchars. To get it to operate on single-quotes, you must tell it to do so. Link to comment https://forums.phpfreaks.com/topic/152126-quotes-causing-errors/#findComment-798960 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.