-
HTML block
This is a lame question and I feel lame for asking it but its late and I dont have time to search on google.
What i need to do is output text from a databse. Problem is, this text can contain things like <A HREF="">whatever</a>
I want the text to show just as text, not links and javascript the usermight want to embed.
Isent there a <SCRIPTBLOCK> or something you can use?
-
There are tags like <xmp></xmp> you can use. I know they are trying to phase out <xmp>, so don't use it. I can't remember what they recomend instead though.
I presume You're using PHP to grao it out of the DB, you could replace all < and > with the actual thingies (hard to explain, code easy to show):
PHP Code:
$str = str_replace("<","<",$str);
$str = str_replace(">",">",$str);
-
You can use php's htmlentities
-
I'm actually using ASP, sorry should have specified.
-
ASP should have something similar, if not, just do a string replace to replace all '<' by "< and all '&' by "&".
In true XHTML, you could use CDATA sections. Alas, IE doesn't support true XHTML.