|
-
Sep 27th, 2004, 12:25 AM
#1
Thread Starter
Fanatic Member
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?
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Sep 27th, 2004, 03:20 AM
#2
Frenzied Member
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);
Have I helped you? Please Rate my posts. 
-
Sep 27th, 2004, 04:58 AM
#3
Frenzied Member
You can use php's htmlentities
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 27th, 2004, 06:05 PM
#4
Thread Starter
Fanatic Member
I'm actually using ASP, sorry should have specified.
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Sep 28th, 2004, 06:01 AM
#5
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|