Cetanu Posted July 15, 2009 Share Posted July 15, 2009 When I have users type their "about me" section, if they use " or ' it comes out \" I was telling them to use ’ for a while, but then I used htmlentities to prevent malicious attacks. How can I make it so " or ' is displayed properly? Link to comment https://forums.phpfreaks.com/topic/166119-display-or/ Share on other sites More sharing options...
p2grace Posted July 15, 2009 Share Posted July 15, 2009 strip_slashes(); http://us.php.net/stripslashes Link to comment https://forums.phpfreaks.com/topic/166119-display-or/#findComment-876091 Share on other sites More sharing options...
genericnumber1 Posted July 15, 2009 Share Posted July 15, 2009 It's likely magic_quotes_gpc if the ' and " are automatically being escaped when inputted. You can turn that off in the php.ini if you promise to escape all input strings with mysql_real_escape_string before using them in a query! Link to comment https://forums.phpfreaks.com/topic/166119-display-or/#findComment-876142 Share on other sites More sharing options...
Cetanu Posted July 16, 2009 Author Share Posted July 16, 2009 So, wait: I did this: <p style="font-size: 1.5em; font-style: italic;"><?php $tag=strip_slashes($row['tagline']); echo $tag; ?></p> And what it does is kill the page content after that ^ And I don't get the post on mysql_real_escape_string(); Link to comment https://forums.phpfreaks.com/topic/166119-display-or/#findComment-876172 Share on other sites More sharing options...
genericnumber1 Posted July 16, 2009 Share Posted July 16, 2009 It's stripslashes, not strip_slashes. And you don't have to copy it to a variable, you can just echo it. Link to comment https://forums.phpfreaks.com/topic/166119-display-or/#findComment-876177 Share on other sites More sharing options...
Cetanu Posted July 16, 2009 Author Share Posted July 16, 2009 Oh, okay. Link to comment https://forums.phpfreaks.com/topic/166119-display-or/#findComment-876188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.