johnsmith153 Posted July 22, 2010 Share Posted July 22, 2010 I have been using mysql_real_escape_string for ages but have come across a site using Magic Quotes Using the modern method I simply use mysql_real_escape_string and htmlspecialchars to ensure all data is posted, added to db and displayed to user. What do I need to do with Magic Quotes enabled (I can't turn them off and do properly) Link to comment https://forums.phpfreaks.com/topic/208491-magic-quotes-mysql_real_escape_string/ Share on other sites More sharing options...
AbraCadaver Posted July 22, 2010 Share Posted July 22, 2010 if(get_magic_quotes_gpc()) { $your_var = stripslashes($your_var); } $your_var = mysql_real_escape_string($your_var); No need to use htmlentities() to store. Use it for display. Link to comment https://forums.phpfreaks.com/topic/208491-magic-quotes-mysql_real_escape_string/#findComment-1089385 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.