Jump to content

Sending data in plain from database to view page problem


karubum

Recommended Posts

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?

 

 

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();
}

}

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.

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.

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

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.