|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Restricting codes and HTML - HELP
Hello.... Good day to all....
![]() i just started learning ASP, im working on something that involves ADO(file.mdb), and i've encountered some problems, i dont know the term for this, how do i prevent HTML and VBscript from executing?.... coz in my page i have this input textbox that u type other infos and then saves it in the Access.mdb file, as i was playing and testing what i did, i realize if i inserted an html or vbscript in my input textbox(other_info) and saved it, once i view that info, the code or the html is being excuted, i was hoping it would just display the codes and html in text only.... hope im not confusing anyone, an example i can think of is like here in aspfree.com, when a member post something that has html and vbscript, once other members viewed the post, it will not run or execute html and vbscript, it will just display it in text.... how can i do that?.... hope to hear from anyone soon, thanks in advance.... ![]() |
|
#2
|
|||
|
|||
|
If I've understood coorectly what you need ... think there is 2 ways you can do this.
1. Use a textarea to display the code. 2. Use ASP to escape the right angle brackets and replace them with < and > ..... so you end up with something like ..... Code:
<code> <html> <body> <p>My Stuff</p> </body> </html> </code> |
|
#3
|
|||
|
|||
|
thanks for ur time....
took me awhile to understand what u were saying.... so what i did is, i used the replace(string, "<", "ascii key")... its working now.... thanks... Quote:
|
|
#4
|
|||
|
|||
|
Quote:
Rather than use a replace (you may not catch everything) use Code:
Response.Write "<br>Input text = " & Server.HTMLEncode(inputtext) |
|
#5
|
|||
|
|||
|
Jonathan,
thanks for ur time.... i'll try what u suggested.... ty... ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Restricting codes and HTML - HELP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|