...

View Full Version : Problem while displaying the content...



Rajesh77
06-25-2010, 08:45 PM
Hi Everyone ,

I have column of data type ntext in my table in database which contains the html content like
[code]
<p style="text-align: center" >this is sample text populated for testing </p>
<b style="text-align: center" >this is sample text populated for testing </b>
etc......
[code]
I want to display the text from database on to the browser . when i am simply getting the value from DB using php and displaying as
echo $row['description'] since the column is very huge the data is occupying
large space on the browser . so, i tried to display that text using the textarea tag in html but the textarea is displaying the content from database as it is with the html tags and not applying any html tags to output like
[code]
<p style="text-align: center" >this is sample text populated for testing </p>
<b style="text-align: center" >this is sample text populated for testing </b>
etc......
[code]
So i need to display the text from database on to the browser by using any tag which can reduce space occupied by text ??????????

Please help me .... Thank in advance ....

Keleth
06-25-2010, 09:02 PM
When you store it to the database, I'm assuming you're sanatizing and converting non-alphanumerics into their html code? Cuz that seems to be whats going on.

Fou-Lu
06-25-2010, 09:22 PM
I'd keep it the way it is if its to be used as HTML. Sounds like this is going into an editor.
Run it through htmlspecialchars() / htmlentities() first before printing it to a text area.
And I'm not sure I follow you on the 'space' part. If its in a text area, you can specify the columns and rows. If its to be displayed as HTML code, you can wrap the entire block in a div with an overflow and height on it to give you scroll bars.
If you mean the actual data size for the space, the only way to get around that is to delete text.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum