elmas156 Posted September 19, 2010 Share Posted September 19, 2010 I've got a simple internal messaging system that I'm trying to get the text to display the way it was entered when a message was sent. The messages are inserted into the database using variables generated through this function: <?php function safe($value){ return mysql_real_escape_string($value); } $staffid=form($_POST['staffid']); $from=safe($_POST["from"]); $category=form($_POST['category']); $subject=safe($_POST["subject"]); $message=safe($_POST["message"]); $grade=form($_POST['grade']); ?> when the text is inserted, there are back slashes automatically inserted behind certain punctuation marks. For example, is someone sends a message that says, "Someone's using phpfreaks forums." It would be inserted as, "Someone\'s using phpfreaks forums." How can I stop this from happening? Or how can I remove the "\" when displaying the string on the web page? Any help is greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/213836-displaying-text-correctly/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 19, 2010 Share Posted September 19, 2010 The problem is due to php's magic quotes - http://www.php.net/manual/en/security.magicquotes.php Quote Link to comment https://forums.phpfreaks.com/topic/213836-displaying-text-correctly/#findComment-1112923 Share on other sites More sharing options...
elmas156 Posted September 19, 2010 Author Share Posted September 19, 2010 Thanks, that explains a lot! Quote Link to comment https://forums.phpfreaks.com/topic/213836-displaying-text-correctly/#findComment-1112967 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.