ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 5th, 2009, 01:16 AM
asianpinoy25 asianpinoy25 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 13 asianpinoy25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 6 m 12 sec
Reputation Power: 0
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....

Reply With Quote
  #2  
Old November 5th, 2009, 09:14 AM
RumblyBear RumblyBear is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 12 RumblyBear User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 12 m 30 sec
Reputation Power: 0
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>

Reply With Quote
  #3  
Old November 10th, 2009, 05:52 AM
asianpinoy25 asianpinoy25 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 13 asianpinoy25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 6 m 12 sec
Reputation Power: 0
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:
Originally Posted by RumblyBear
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>

Reply With Quote
  #4  
Old November 10th, 2009, 05:58 AM
Jonathan8146 Jonathan8146 is offline
Contributing User
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2005
Posts: 1,708 Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level)Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level)Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level)Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level)Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level)Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level)Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level)Jonathan8146 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 3 h 50 m 45 sec
Reputation Power: 177
Quote:
Originally Posted by asianpinoy25
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...


Rather than use a replace (you may not catch everything) use
Code:
Response.Write "<br>Input text = " & Server.HTMLEncode(inputtext)

Reply With Quote
  #5  
Old November 11th, 2009, 08:18 PM
asianpinoy25 asianpinoy25 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 13 asianpinoy25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 6 m 12 sec
Reputation Power: 0
Jonathan,

thanks for ur time.... i'll try what u suggested.... ty...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Restricting codes and HTML - HELP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek