Solved

Passing & as a parameter value

Posted on 2004-08-16
7
282 Views
Last Modified: 2012-05-05
Is there a way of passing an & as a querystring value.

We are having a problem as obviously the & is used to seperate parameters but we need to pass one as part of a paramater.

2.asp?CoName=Alf & Burns
0
Comment
Question by:Kels
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 10

Expert Comment

by:Jay Toops
Comment Utility
You must use the function urlencode("Alf & Burns")

example:

<%
response.write(Server.URLEncode("http://www.w3schools.com"))
%>Output:

http%3A%2F%2Fwww%2Ew3schools%2Ecom

special characters are meta-escaped using this
and are AUTOMATICALLY decoded by the server
so when you are processing this with your handler
you don't have to do anything else.

Jay
0
 
LVL 6

Accepted Solution

by:
philjones85 earned 125 total points
Comment Utility
2.asp?CoName=Alf & Burns

place %26 in place of & and place %20 in place of spaces


string should be:

2.asp?CoName=Alf%20%26%20Burns
0
 
LVL 6

Expert Comment

by:philjones85
Comment Utility
http://www.w3schools.com/html/html_ref_urlencode.asp

complete list of url encoded characters
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 35

Expert Comment

by:YZlat
Comment Utility
try this:

strString = replace(strString,"&","&amp;")
0
 
LVL 35

Expert Comment

by:YZlat
Comment Utility
also try

strString=replace( strString,"&","and")
0
 
LVL 13

Expert Comment

by:davidlars99
Comment Utility
hi,
in javascript you'd do escape(2.asp?CoName=Alf & Burns)
and unescape()

cheers!
 dave
0
 
LVL 10

Expert Comment

by:Jay Toops
Comment Utility
HI.. could you award points for this?
Id really appreciate it..

Jay
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now