kevinritt Posted August 27, 2009 Share Posted August 27, 2009 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 More sharing options...
ignace Posted August 27, 2009 Share Posted August 27, 2009 <tr> <td class=\"header\">Name</td> <td class=\"header\">Title</td> <td class=\"header\">Email</td> </tr> perform stripslashes before you output it. Link to comment https://forums.phpfreaks.com/topic/172177-content-output-via-tinymce/#findComment-907868 Share on other sites More sharing options...
kevinritt Posted August 27, 2009 Author Share Posted August 27, 2009 Would this: echo $row->content; be changed to: echo stripslashes($row->content); Link to comment https://forums.phpfreaks.com/topic/172177-content-output-via-tinymce/#findComment-907879 Share on other sites More sharing options...
ignace Posted August 27, 2009 Share Posted August 27, 2009 Would this: echo $row->content; be changed to: echo stripslashes($row->content); If that contains the html code then yes. Link to comment https://forums.phpfreaks.com/topic/172177-content-output-via-tinymce/#findComment-907908 Share on other sites More sharing options...
kevinritt Posted August 27, 2009 Author Share Posted August 27, 2009 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 Link to comment https://forums.phpfreaks.com/topic/172177-content-output-via-tinymce/#findComment-907912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.