Insert and retrieved html and css formated text in Database
Posted: Thu Dec 08, 2011 1:13 pm
Hi guys,
How to keep styled and formated text in db and retrieve it?
My CMS has an "insert post" option. Where a title, a text and a picture can be inserted.
All this is inserted in databaSe, AND is retrieved in the home page.
The text just appears as simple text, no formating. all spaces and line breaks are ignored.
I tried installing a Rich text editor and name all the textareas after it but it was a failed attempt.
so I want to be able to insert html text.
for example.
<h2>Winter Party</h2>
<br>
<br>
<p style="color:red">Don' miss it!!!</p>
<p>some text some text some text, some text <u>some</u> text
<br>
some text.......
</p>
I heard that it's also possible to actually store "PHP" script inside a database table.
I tried to change the field type to "mediumblob" no success!, if i insert any php code in the textarea, all the text
disapears, and for the html, is just not doing anything.
Any help please,
Many thanks i advance,
Mike
How to keep styled and formated text in db and retrieve it?
My CMS has an "insert post" option. Where a title, a text and a picture can be inserted.
All this is inserted in databaSe, AND is retrieved in the home page.
The text just appears as simple text, no formating. all spaces and line breaks are ignored.
I tried installing a Rich text editor and name all the textareas after it but it was a failed attempt.
so I want to be able to insert html text.
for example.
<h2>Winter Party</h2>
<br>
<br>
<p style="color:red">Don' miss it!!!</p>
<p>some text some text some text, some text <u>some</u> text
<br>
some text.......
</p>
I heard that it's also possible to actually store "PHP" script inside a database table.
I tried to change the field type to "mediumblob" no success!, if i insert any php code in the textarea, all the text
disapears, and for the html, is just not doing anything.
Any help please,
Many thanks i advance,
Mike