Jump to content

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

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.