kilz 0 Report post Posted October 19, 2004 hellohow do i disable html tags in a part of html page?? Share this post Link to post Share on other sites
lhunath 0 Report post Posted October 19, 2004 <pre> <p>lalalalalal</p> </pre> will show: <p>lalalalalal</p> rather than: lalalalalal I think that's what you need? Share this post Link to post Share on other sites
kilz 0 Report post Posted October 19, 2004 I want to display the html code, also disable their function. for example: if I type: <b>fjdsgfjds</b> output = fjdsgfjds != fjdsgfjds but I don't want any php or javascript code. . . Share this post Link to post Share on other sites
marijnnn 0 Report post Posted October 19, 2004 then, there's no such thing. you'll have to use either a client or server side script. i'd advise php, because then your output doens't depend on the client having javascript enabled or not. but javascript is probably the easiest.http://forums.xisto.com/no_longer_exists/that should help you outbut i'd still advise you to use php though, or another serverside script.+ i don't really get the use but whatever Share this post Link to post Share on other sites
lhunath 0 Report post Posted October 19, 2004 I want to display the html code, also disable their function. for example: if I type: <b>fjdsgfjds</b> output = fjdsgfjds != fjdsgfjds but I don't want any php or javascript code. . . <{POST_SNAPBACK}> How does that display the html code...? :/ Share this post Link to post Share on other sites
r3d1405241470 0 Report post Posted October 20, 2004 save your file as text, the server wont parse that as html.also try "<" it will show < and ">" show > in html.for example.<B> This is not bold </B>output:<B>This is not bold</B>hope that helps Share this post Link to post Share on other sites
kilz 0 Report post Posted October 20, 2004 How does that display the html code...? :/sorry, it should be: <b>fjdsgfjds</b>save your file as text, the server wont parse that as html.also try "<" it will show < and ">" show > in html.for example.<B> This is not bold </B>output:<B>This is not bold</B>hope that helpsthanks a lot, but please tell what it means, < >are they ascii code of < and >??-------------in php, we can use htmlspecialchars() to display and disable html.in javascript, how??I would like to create some html tutorial for my site, so disable them. Share this post Link to post Share on other sites
marijnnn 0 Report post Posted October 20, 2004 ok, i really don't get your question anymore, but whatever: normal situation: if your code is: <b>bold</b> they will see bold 1. if you want the users to see your html code instead of the effect it has, use <pre> your code: <b>bold</b> on their screen: <b>bold</b> another option to do this is the way r3d described: you use the html special characters instead of the real character. you can make a javascript function that replaces every "<" by "<", every ">" by ">" etc 2. if you want to strip all the tags: your code: <b>bold</b> they see: bold what you need to do is strip the html tags so wherever you find something like <xxx> (regular expression: /<[^>]*>/) replace it by an empty string. if this still doesn't help you, please tell us which one of these two things you want. Share this post Link to post Share on other sites
kilz 0 Report post Posted October 20, 2004 it helps a lotthanks a lot. . . Share this post Link to post Share on other sites
marijnnn 0 Report post Posted October 20, 2004 glad to be at your service Share this post Link to post Share on other sites
overture 0 Report post Posted October 20, 2004 wasnt this solved in the first reply by lhunath? being as it was the right answer. at least in my mind it was. Share this post Link to post Share on other sites
lhunath 0 Report post Posted October 20, 2004 wasnt this solved in the first reply by lhunath? being as it was the right answer. at least in my mind it was. <{POST_SNAPBACK}> That's what I thought, but what the heck, if they want to go and replace all < with < 's and > with > 's, then fine with me; I won't be the one writing it Share this post Link to post Share on other sites
r3d1405241470 0 Report post Posted October 20, 2004 in php, we can use htmlspecialchars() to display and disable html. in javascript, how?? I would like to create some html tutorial for my site, so disable them. <{POST_SNAPBACK}> eerrrr don't do this, don't use js or php to disable html code. once you did this, is just like opening a door to a script kiddies just use html entities e.g. < = <, > = >, © = Š and soon... html entities whon't envote any markup it just kind a replacement... Share this post Link to post Share on other sites
Bigyan 0 Report post Posted October 26, 2004 The cleanest way to go about doing this would be :>> Use Javascript to write a parser (its going to be tough)>> Use server side scripting.But anyway, what do you want this for ??? Share this post Link to post Share on other sites
avalon1405241471 0 Report post Posted October 27, 2004 There is a much simplier way that works all the time.See Code <textarea cols="25" rows="5"><b>My Name</b></textarea> Share this post Link to post Share on other sites