[thelist] ASP - & Encoding

Feingold Josh S Josh.S.Feingold at irs.gov
Fri Mar 22 12:38:01 CST 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
Yeah, I tried encoding the URL by hand, and it still seems to fail.

I used "phone=AT%26T", but no luck.

Josh

-----Original Message-----
From: Chris Blessing [mailto:webguy at mail.rit.edu]
Sent: Friday, March 22, 2002 1:38 PM
To: thelist at lists.evolt.org
Subject: RE: [thelist] ASP - & Encoding


Your querystring needs to be server.urlencoded() before you can pass it in,
otherwise the value (let's say it was myname=Chris&Blessing) will be
truncated at the & character (making request("myname") = "Chris" instead of
"Chris&Blessing").  If you urlencode() your querystring values, they are
automagically (there's that coined phrase again) converted back (urldecoded,
if you will).

Take for example:

You have a page and need to pass a key=value pair the querystring
- the value of the key will contain several & characters.
- sending it as-is will produce a "key=text+text+&+text+&+text" which will
not be decoded properly due to the unescaped & character
- sending it by doing this: strVal = server.URLEncode(strVal) will escape
special characters by converting them to their ascii equivilents (such as
%20 for spaces)

Once you receive the value on the next page (or the same page, if you're
re-requesting it) it will be decoded automatically.

Ref: http://www.devguru.com/Technologies/asp/quickref/server_urlencode.html

HTH!

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of Feingold Josh S
> Sent: Friday, March 22, 2002 1:23 PM
> To: 'thelist at lists.evolt.org'
> Subject: [thelist] ASP - & Encoding
>
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
> --
> [ Picked text/plain from multipart/alternative ]
> How do I pass an ampersand from via a querystring into a SQL query?
>
> Thanks,
> Josh
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !



More information about the thelist mailing list