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 September 5th, 2008, 10:57 AM
stephenbayer stephenbayer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 3 stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 56 m 8 sec
Reputation Power: 0
General - Question - Properly encoded quoted strings

I don't exactly know how to even phrase my question with the correct wording. I don't use ASP too often, and I'm looking to save information to a <input type="hidden" /> field, but it gets all screwed up because the information I'm saving in the field has characters that are ungood. as an example if I try and save certain data in the hidden field with:
Code:
<input id="fldData" 
          name="fldData" 
          type="hidden" 
          value="<%= strData %>" />


I can get garbage like:

Code:
<input id="fldData" 
          name="fldData" 
          type="hidden" 
          value=" Hello with line feeds
<  and angle brackets > 
" and even ' quotes "

This is no good!!" />



Is there someway to encode this stuff with a asp/vbscript command? and if so, do i need to decode it when I get it using:

Code:
Dim strData
strData = Request.QueryString("fldData")

Reply With Quote
  #2  
Old September 5th, 2008, 11:41 AM
stephenbayer stephenbayer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 3 stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level)stephenbayer User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 56 m 8 sec
Reputation Power: 0
I think I figured it out myself. I hope it will work, it seems to:

Code:
value="<% Server.HTMLEncode(strData) %>"
Comments on this post
keep_it_simple agrees: thanks for sharing for others to learn from
Shadow Wizard agrees: thanks for sharing

Reply With Quote
  #3  
Old September 7th, 2008, 06:47 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 47th Plane (28000 - 28499 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,432 Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 18th Grade (Above 100000 Reputation Level)  Folding Points: 478881 Folding Title: Super Ultimate Folder - Level 1Folding Points: 478881 Folding Title: Super Ultimate Folder - Level 1Folding Points: 478881 Folding Title: Super Ultimate Folder - Level 1Folding Points: 478881 Folding Title: Super Ultimate Folder - Level 1Folding Points: 478881 Folding Title: Super Ultimate Folder - Level 1Folding Points: 478881 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 1 Day 1 h 1 m 6 sec
Reputation Power: 2190
you can also use Session variables, this way in case you have sensitive information
it won't be visible at all in the HTML source, right now the user can right click
and choose View Soruce, and all the "hidden" values are visible there.
Comments on this post
Nilpo agrees!

Reply With Quote
  #4  
Old September 7th, 2008, 07:12 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,668 Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)Nilpo User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 1 Day 8 h 25 m 52 sec
Reputation Power: 867
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
Shad is right. You should use session variables for sending form data between pages.

Hidden form fields are for storing/sending dynamically populated fields that do not require user input.
__________________
Don't like me? Click it.

Scripting problems? Windows questions? Ask the Windows Guru!

Stay up to date with all of my latest content. Follow me on Twitter!

Help us help you! Post your exact error message with these easy tips!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > General - Question - Properly encoded quoted strings


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 5 hosted by Hostway
Stay green...Green IT