Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Querystrings different in straight HTML and delimited ASP

11 views
Skip to first unread message

.Net Sports

unread,
Dec 24, 2009, 2:11:49 PM12/24/09
to
I have querystrings that are referencing the same queried object:

HTML: <a href="?qencl=<%=qencl%>&cat=<%=qc%> ....

ASP: Response.Write "<a href=?qencl="&qencl&"&cat="&qc&"...

the queried object "cat" does not break up if the "cat" has spaces in
it on the "HTML" version

the queried object "cat" breaks off at the first space in the "ASP:
version

HTML = http://www.mysite.com/my.asp?qencl=sup&cat=Critical
Infrastructure and Key Resources

ASP: = http://www.mysite.com/my.asp?qencl=sup&cat=Critical

not sure to what extent i need to use Server.URLEncode in this snafu

???
NS

Adrienne Boswell

unread,
Dec 24, 2009, 4:37:31 PM12/24/09
to
Gazing into my crystal ball I observed ".Net Sports"
<ballz...@cox.net> writing in news:46fdbede-f1a6-4711-952f-
87c689...@h14g2000pri.googlegroups.com:

dim q, r, t
q = 1
r = 2
t = 3

Response.Write "<a href=" & chr(34) & "somepage.asp?q=" & id &
"&amp;r=" & col & "&amp;t=" & tld & chr(34) & ">somepage</a>"

which the browser will parse as
<a href="somepage.asp?q=1&r=2&t=3">somepage</a>

The & character should be escaped &amp; except in the case of a
response.redirect or server.transfer, and the quotation marks should
remain in place. Others use double quotes, but I prefer using chr(34)
instead - it's easier to debug.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Dan

unread,
Dec 30, 2009, 4:38:21 AM12/30/09
to

".Net Sports" <ballz...@cox.net> wrote in message
news:46fdbede-f1a6-4711...@h14g2000pri.googlegroups.com...


In the latter case you are not quoting the URL, which is why a space causes
a problem. You should never be using spaces in URLs though.

In both case, use Server.URLEncode to encode each value, eg.

Response.Write "<a href=""?qencl=" & Server.URLEncode(qencl) & "&cat=" &
Server.URLEncode(qc) & ... """>"


note that I've also added "" after the href=, this is one way to add double
quotes into strings in ASP VBScript; another being the Chr(34) that Adrienne
has suggested.

--
Dan

eJeeban Design

unread,
Feb 16, 2023, 1:17:40 AM2/16/23
to
Thanks for the useful tips

eJeeban Design
https://www.ejeeban.com

Dane christian Neilson

unread,
Dec 13, 2023, 9:36:08 AM12/13/23
to
MT103/202 DIRECT WIRE TRANSFER
PAYPAL TRANSFER
CASHAPP TRANSFER
ZELLE TRANSFER
LOAN DEAL

TRANSFER WISE
WESTERN UNION TRANSFER
BITCOIN FLASHING
BANK ACCOUNT LOADING/FLASHING
IBAN TO IBAN TRANSFER
MONEYGRAM TRANSFER
IPIP/DTC
SLBC PROVIDER
CREDIT CARD TOP UP
DUMPS/ PINS
SEPA TRANSFER
WIRE TRANSFER
BITCOIN TOP UP
GLOBALPAY INC US
SKRILL USA
UNIONPAY RECEIVER

Thanks.



NOTE; ONLY SERIOUS / RELIABLE RECEIVERS CAN CONTACT.

DM ME ON WHATSAPP
+13855324926
0 new messages