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? Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.