Jump to content

content output via TinyMCE


kevinritt

Recommended Posts

Hi,

I'm not sure if this is a PHP issue or TinyMCE. I have content that is saved in a database. It gets called using this code:

<?php
		$page = (isset($_GET['page'])) ? $_GET['page'] : "1";
		$sql = "SELECT content FROM pages WHERE id='$page'";
		$result = $conn -> query($sql) or die(mysqli_error());
			if($result) {
			$row = $result->fetch_object();
				echo $row->content;
			}   
           
   		?>

The problem is when the code is out put on the site. I save the html like this:

 <tr>
<td class="header">Name</td>
<td class="header">Title</td>
<td class="header">Email</td>
</tr>

but it ends up looking like this:

<tr>
<td class=\"header\">Name</td>
<td class=\"header\">Title</td>
<td class=\"header\">Email</td>
</tr>

Futhermore, it gets processed like this in TinyMCE:

<tr>
<td class="\"header\"">Name</td>
<td class="\"header\"">Title</td>
<td class="\"header\"">Email</td>
</tr>

 

Because of this the CSS classes and IDs do not work. Is there something I can do that would remove the extra characters?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/172177-content-output-via-tinymce/
Share on other sites

still not working

Here's the current page: http://saugustv.org/index.php?page=contact

and here's the page with the call to the database and the text editor:

http://saugustv.org/indexLiveTest.php?page=2

They use the same CSS but as you can see they don't look the same.

Any help would be appreciated - I'm clueless at this point

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.