scarhand Posted October 6, 2007 Share Posted October 6, 2007 I'm having problems passing an ampersand through AJAX to a database. htmlspecialchars will convert and send all other chars to the database, except ampersand heres my message variable before its inserted into the database: $message = mysql_real_escape_string(htmlspecialchars($_POST['message'], ENT_QUOTES)); is there any other php procedures that I could use so that my AJAX script will pass ampersands into the database? Link to comment https://forums.phpfreaks.com/topic/72053-pass-an-ampersand-to-a-database-through-ajax/ Share on other sites More sharing options...
zq29 Posted October 9, 2007 Share Posted October 9, 2007 You could encode it with urlencode() - The problem with htmlentities() is that the encoded version still has an ampersand it in! Link to comment https://forums.phpfreaks.com/topic/72053-pass-an-ampersand-to-a-database-through-ajax/#findComment-365551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.