karubum Posted September 19, 2012 Share Posted September 19, 2012 I am using CKEditor to send data into my "news" table in news database. When I send it, the data is as follow: <table> <tr> <td>This is a sample news</td> </tr> </table> When I try to send this data to the view page with: <? echo $news_data; ?> it shows my data with source code: <table> <tr> <td>This is a sample news</td> </tr> </table> I want to show my data with tags as it does above (<table>...</table>) instead I want just "This is a sample news". What should I do? Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/ Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 Somewhere along the lines the data is being converted into html_entities, so the < symbol is changed to < and so on. You'll have to figure out where. Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379252 Share on other sites More sharing options...
jason360 Posted September 19, 2012 Share Posted September 19, 2012 Thanks alot jesi---you need to relax!!! Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379255 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 Uhm, what? PS: http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html http://theoatmeal.com/comics/misspelling Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379256 Share on other sites More sharing options...
spiderwell Posted September 19, 2012 Share Posted September 19, 2012 You need to get the information from the ckeditor object and pass it to the textarea, its a odd beast this editor, here's one i used on a site, you should be able to work out what is going on, curator_mission_english is the name of my text area function checksubmit() { if (CKEDITOR.instances.curator_mission_english) { document.getElementById('curator_mission_english').value=CKEDITOR.instances['curator_mission_english'].getData(); } if (CKEDITOR.instances.curator_mission_french) { document.getElementById('curator_mission_french').value=CKEDITOR.instances['curator_mission_french'].getData(); } } Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379257 Share on other sites More sharing options...
jason360 Posted September 19, 2012 Share Posted September 19, 2012 <search link removed> Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379259 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 Jason, for one, this isn't even your topic!! Secondly, my response to the OP was probably one of my most polite, so it's very odd that you're freaking out about it. If the OP has a problem he can probably handle it himself. Thirdly, if you can't handle someone correcting your spelling, you're going to have a hard time with this whole internet thing. Please refrain from using language like that. Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379260 Share on other sites More sharing options...
White_Lily Posted September 19, 2012 Share Posted September 19, 2012 Im slightly confused... is the OP trying to get data from a database, or get data and update it? Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379262 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 I read it as the OP has stored HTML in his database, and when he tries to echo it on a page, the HTML shows up as <td> etc, instead of being rendered as HTML. Hence my explanation of how the entities have been converted. Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379263 Share on other sites More sharing options...
spiderwell Posted September 19, 2012 Share Posted September 19, 2012 its a very specific CKEDITOR quirk, i have posted the answer which worked for me when I had the same issue Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379264 Share on other sites More sharing options...
White_Lily Posted September 19, 2012 Share Posted September 19, 2012 Ah I've googled what CKEditor is, I can't help here I use TinyMCE Editors as they work better with my CMS. Sorry. Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379266 Share on other sites More sharing options...
spiderwell Posted September 19, 2012 Share Posted September 19, 2012 at least the dropped the F from the name, it used be FCKEditor, which always amused me Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379281 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 at least the dropped the F from the name, it used be FCKEditor, which always amused me I remember that! Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379284 Share on other sites More sharing options...
PFMaBiSmAd Posted September 19, 2012 Share Posted September 19, 2012 You can turn off the behavior - <static> {Boolean} CKEDITOR.config.entities Since: 3.0 Whether to use HTML entities in the output. Defined in: plugins/entities/plugin.js. config.entities = false; Default Value: true Quote Link to comment https://forums.phpfreaks.com/topic/268556-sending-data-in-plain-from-database-to-view-page-problem/#findComment-1379291 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.