Jump to content

Displaying Text Correctly.


elmas156

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/213836-displaying-text-correctly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.