Jump to content

Using RTE all "s turn into \" why?


alisemail

Recommended Posts

So I've installed an RTE thats javascript based and utilize it to styelize text. When submitted the following code executes

 

	$content = $_POST['rte1'];
$name = $_POST['name'];
$year = $_POST['year'];
mysql_query("INSERT INTO $campaign_table (name, current, year, overview) VALUES
		('$name', '$current', '$year', '$content')");

mysql_close($link);

$confirm = "<h2>$name for $year has been added!</h2>\n";
$confirm .= "<p>The Details is as follows</p>\n";
if($current == 1)
{
	$confirm .= "<p>This campaign is marked as the current campaign</p>\n";
}

$confirm .= "<p>" . $content . "</p>\n";

 

In the MySQL Database the following is the value:

<span style="font-weight: bold;">ddsdsd 

</span>

 

When I echo it out in the page with

<? if(isset($confirm))
{
	print $confirm;
}
?>

(I've tried both print and echo both do the same)

 

The source code shows

<p><span style=\"font-weight: bold;\">ddsdsd 

</span></p>

 

 

Any ideas as to why these \'s are added?

 

Thanks in advance.

Link to comment
Share on other sites

They are added to stop you ending your current function etc.

 

echo "i am an echo if i wanted to type a quote or select information inside this speech i could use 'apostrophes' or /"magic quotes/"

It basically tells the php to ignore the speech marks coming up.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.