the # sign is still there, that's why I'm asking. when it has the # sign, it messes up the rest of the data below it. when it's gone, it fixes the issue.
Main Topics
Browse All Topicswhy doesn't this work?
ADDR1 = Request.Querystring("val20
ADDR1 = Replace( ADDR1,"#","" )
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
As a backing up of b0lsc0tt answer
you can check out these links to get a better understanding of URL encoding
http://www.permadi.com/tut
http://www.permadi.com/tut
Do Not accept this as the answer b01sc0tt deserves the credit on this one
i'm lost on this one. i've tried all the above, and the # won't go away. i've tried all these variants:
ADDR1 = Replace(ADDR1,"#","")
ADDR1 = Replace( ADDR1,"#","" )
ADDR1 = Replace(ADDR1, "%23", "")
ADDR1 = Replace( ADDR1, "%23", "" )
ADDR1 = Replace(ADDR1, "#", "%23")
ADDR1 = Replace( ADDR1, "#", "%23" )
no luck. here is the code from the previous page where it gets posted, maybe this will help:
<td>
<a href="gas_print.asp?val1=<
</td>
Try this
ADDR1 = Replace(Request.QUeryStrin
IF that does not work then try
ADDR1 = Replace(Request.QUeryStrin
Also look at the query string in the address bar and look for val20 check to see what it says for that and then put that value in here so we can see maybe there is something with what you have for your data..
that didn't work either.
i'm using firefox and IE6 to test.
let me give a little more info, maybe this will help.
two pages are being used:
#1 = memberno_list.asp ** has this code: <a href="gas_print.asp?val1=<
#2 = gas_print.asp ** has this code: ADDR1 = Replace(ADDR1,"#","")
If I use the replace code on page #1, it works fine (cleanup the text before I passit to the URL), but it won't work on page#2 (after it's in the URL). The reason i'm trying to get this working on page#2 is because I would have to update up to 50 pages each time I go through a routine to make this print function work. (long story) If i can get the replace code to work in page#2, i don't ever have to update the 50+ pages each time in #1.
since the text is already passed to the url, i would think i could manipulate it before it gets to the field that I response.write it out, and fix my problem. easier said than done i guess.
Only 50 pages?? Why not just update them? :D
This problem isn't rare. I have seen issues like this that can be a little work to figure out. Best way to do it is before, like you already mentioned, but it would definitely be a lot of work in this case. The code below should break tell us the Ansi code for each character (formatted as code[character],). You could also copy the information in some Hex editor program to get he information. The code below is a modified version of code by Acperkins in http://www.experts-exchang
Dim i
For i = 1 to Len(ADDR1)
Response.Write Asc(Mid(ADDR1, i, 1)) & "[" & Mid(ADDR1, i, 1) & "], "
Next
Those results show that ADDR1 contained "2905 LIBRARY LN" (no quotes). If you response.write ADDR1 then do you see the leading # sign? If not, then where do it appear?
Instead of using ADDR1 in the code I provided try using Request.Servervariables("Q
URL encoding has been mentioned already above, but has it been tried?
On the previous page where it gets posted, try this:
<%
Dim URLParams
URLParams = "?val1=" & x_MBRSEP
URLParams = URLParams & "&val2="& x_NAME
URLParams = URLParams & "&val3=" & x_RATE
URLParams = URLParams & "&val4=" & x_CLASS
URLParams = URLParams & "&val5=" & x_TELEPHONE
URLParams = URLParams & "&val6=" & x_LOCATION
URLParams = URLParams & "&val7=" & x_METER
URLParams = URLParams & "&val8=" & x_READDATE
URLParams = URLParams & "&val9=" & x_READDATE
URLParams = URLParams & "&val10=" & x_NBRDAYSSVC
URLParams = URLParams & "&val11=" & x_PREVMTRREAD
URLParams = URLParams & "&val12=" & x_METERREAD
URLParams = URLParams & "&val13=" & x_KWH
URLParams = URLParams & "&val14=" & x_FUEL2
URLParams = URLParams & "&val15=" & x_APPLNBR
URLParams = URLParams & "&val16=" & x_DUEDATE
URLParams = URLParams & "&val17=" & x_MISCCHG
URLParams = URLParams & "&val18=" & x_CYCLE
URLParams = URLParams & "&val19=" & x_BILLDATE
URLParams = URLParams & "&val20=" & x_ADDR1
URLParams = URLParams & "&val21=" & x_ADDR2
URLParams = URLParams & "&val22=" & x_ADDR3
URLParams = Server.URLEncode(URLParams
%>
<td>
<a href="gas_print.asp<%=URLP
</td>
>>>>>>>>>>>>>>>>>>>>>>>>>>
Comment from b0lsc0tt
Date: 09/15/2006 11:41AM PDT
Comment Accept
What is the "code" for the # character?
>>>>>>>>>>>>>>>>>>>>>>>>>>
b0lsc0tt,
not sure what planet i was one, but i just figured out what you were asking. the code to convert it to ansi stops when it sees the # sign. so it never gives me the "code" for the # symbol.
i just now re-read your other response (The code below should break tell us the Ansi code for each character (formatted as code[character],)) and figured out how you got text out of all those jumbled #'s and letters...(haha)
anway, to reiterate, the ansi code stops when it see's a #, and gives no code.
that is a sweet trick for future use though.
thanks,
bschwarting
I'm glad you are back on this planet and my comments make a little more sense. :D I agree that the code is pretty sweet and worth keeping handy.
Did you also try using Request.Servervariables("Q
Thanks in advance for your reply and the additional info.
No. I may have misunderstood but I want you to use the following to show the WHOLE querystring.
Dim i
For i = 1 to Len(Request.Servervariable
Response.Write Asc(Mid(Request.Servervari
Next
If that is what you used then I apologize but it seems that you used Request.Querystring("val20
Can you provide a URL for me to test? I can't remember if you mentioned this already or if I have asked but did you test on other browsers or computers?
Thanks!
IE and firefox
here is the end of it, same thing, stops after the #
118[v], 97[a], 108[l], 50[2], 48[0], 61[=], 49[1], 48[0], 48[0], 37[%], 50[2], 48[0], 67[C], 72[H], 69[E], 82[R], 79[O], 75[K], 69[E], 69[E], 37[%], 50[2], 48[0], 83[S], 84[T], 37[%], 50[2], 48[0], 83[S], 85[U], 73[I], 84[T], 69[E], 37[%], 50[2], 48[0], 37[%], 50[2], 48[0],
value 20 = ADDR1 = 100 CHEROKEE ST SUITE # 410
So you also saw all of the other name/value pairs before that section you copied in your comment? Did you get val21 or val22? Can you see more of the querystring in your browser's address bar?
It has been a little while since we started this and I didn't find this information while quickly reading the previous comments but please forgive me if I overlooked it. Is this info coming from a form? User/visitor input? If not what is the source? If it is a form try changing the method to POST. Does that fix the problem? Although the earlier comments and discussion didn't seem like the problem was related to length limits on the querystring that may explain why it is completely cut off, especially if you don't get the final 2 name/values either.
Are there actually 2 spaces after SUITE in the address?
there are actually 42 variables, i just removed some for simplicity sake.
no matter where i put the # symbol in the data, it always stops at it (#), whether it's val1 or val42.
the # is currently in val20, so no, i don't get val21 or val22 or beyond...
yes, i see all the data in the browsers address bar.
yes, there are 2 spaces after SUITE in the address
data is posted via a form with the POST method, using this:
<a href="gas_print.asp?val1=<
Thanks for the information and answers.
Copy the URL from your browser's address bar starting at the character to the right of the question mark (?) until the end. That should be the complete querystring. Copy the information into a variable and try running the ASCII character loop on that variable. Let me know if you have questions about doing this. Let's see if we get the results for the # sign now.
Are you using the post method for your form and also putting information in the querystring? You used the anchor tag in your last comment and that is different from a form and will only send information via the querystring. The anchor tag does not have a "post method." If the information is in an anchor tag then it is not coming directly from a form but from that anchor tag. What builds that tag and the information in its URL? Could the # sign be getting changed by some step in the process that you haven't mentioned or is it coming from a database? These questions are to see if we can find some other way to identify the character.
I do appreciate your patience as we try to get this to work. Keep in mind that we are trying to "fix" something that is "broken." The real solution would be correcting the page submitting the information and we may not be able to find a way to solve it in the page getting the info. In this case it will be better if we can get it to work but that may not be possible.
Let me know what you get or if you have any questions.
I know this is a bit late but this may help others out in the future
' Decode the urlEncoded Query String Referer data
Function URLDecode(str)
str = uCase(str)
str = Replace(str, "%20", " ")
str = Replace(str, "%21", "!")
str = Replace(str, "%22", Chr(34))
str = Replace(str, "%23", "#")
str = Replace(str, "%24", "$")
str = Replace(str, "%25", "%")
str = Replace(str, "%26", "&")
str = Replace(str, "%27", "'")
str = Replace(str, "%28", "(")
str = Replace(str, "%29", ")")
str = Replace(str, "%2A", "*")
str = Replace(str, "%2B", "+")
str = Replace(str, "%2C", ",")
str = Replace(str, "%2D", "-")
str = Replace(str, "%2E", ".")
str = Replace(str, "%2F", "/")
str = Replace(str, "%30", "0")
str = Replace(str, "%31", "1")
str = Replace(str, "%32", "2")
str = Replace(str, "%33", "3")
str = Replace(str, "%34", "4")
str = Replace(str, "%35", "5")
str = Replace(str, "%36", "6")
str = Replace(str, "%37", "7")
str = Replace(str, "%38", "8")
str = Replace(str, "%39", "0")
str = Replace(str, "%3A", ":")
str = Replace(str, "%3B", ";")
str = Replace(str, "%3C", "<")
str = Replace(str, "%3D", "=")
str = Replace(str, "%3E", ">")
str = Replace(str, "%3F", "?")
str = Replace(str, "%40", "@")
str = Replace(str, "%41", "A")
str = Replace(str, "%42", "B")
str = Replace(str, "%43", "C")
str = Replace(str, "%44", "D")
str = Replace(str, "%45", "E")
str = Replace(str, "%46", "F")
str = Replace(str, "%47", "G")
str = Replace(str, "%48", "H")
str = Replace(str, "%49", "I")
str = Replace(str, "%4A", "J")
str = Replace(str, "%4B", "K")
str = Replace(str, "%4C", "L")
str = Replace(str, "%4D", "M")
str = Replace(str, "%4E", "N")
str = Replace(str, "%4F", "O")
str = Replace(str, "%50", "P")
str = Replace(str, "%51", "Q")
str = Replace(str, "%52", "R")
str = Replace(str, "%53", "S")
str = Replace(str, "%54", "T")
str = Replace(str, "%55", "U")
str = Replace(str, "%56", "V")
str = Replace(str, "%57", "W")
str = Replace(str, "%58", "X")
str = Replace(str, "%59", "Y")
str = Replace(str, "%5A", "Z")
str = Replace(str, "%5B", "[")
str = Replace(str, "%5C", "\")
str = Replace(str, "%5D", "]")
str = Replace(str, "%5E", "^")
str = Replace(str, "%5F", "_")
str = Replace(str, "%60", "`")
str = Replace(str, "%61", "a")
str = Replace(str, "%62", "b")
str = Replace(str, "%63", "c")
str = Replace(str, "%64", "d")
str = Replace(str, "%65", "e")
str = Replace(str, "%66", "f")
str = Replace(str, "%67", "g")
str = Replace(str, "%68", "h")
str = Replace(str, "%69", "i")
str = Replace(str, "%6A", "j")
str = Replace(str, "%6B", "k")
str = Replace(str, "%6C", "l")
str = Replace(str, "%6D", "m")
str = Replace(str, "%6E", "n")
str = Replace(str, "%6F", "o")
str = Replace(str, "%70", "p")
str = Replace(str, "%71", "q")
str = Replace(str, "%72", "r")
str = Replace(str, "%73", "s")
str = Replace(str, "%74", "t")
str = Replace(str, "%75", "u")
str = Replace(str, "%76", "v")
str = Replace(str, "%77", "w")
str = Replace(str, "%78", "x")
str = Replace(str, "%79", "y")
str = Replace(str, "%7A", "z")
str = Replace(str, "%7B", "{")
str = Replace(str, "%7C", "|")
str = Replace(str, "%7D", "}")
str = Replace(str, "%7E", "~")
str = Replace(str, "%io", "h")
str = Replace(str, "%A0", " ")
str = Replace(str, "%A1", "¡")
str = Replace(str, "%A2", "¢")
str = Replace(str, "%A3", "£")
str = Replace(str, "%A4", "¤")
str = Replace(str, "%A5", "¥")
str = Replace(str, "%A6", "¦")
str = Replace(str, "%A7", "§")
str = Replace(str, "%A8", "¨")
str = Replace(str, "%A9", "©")
str = Replace(str, "%AA", "ª")
str = Replace(str, "%AB", "«")
str = Replace(str, "%AC", "")
str = Replace(str, "%AD", "")
str = Replace(str, "%AE", "®")
str = Replace(str, "%AF", "¯")
str = Replace(str, "%B0", "°")
str = Replace(str, "%B1", "±")
str = Replace(str, "%B2", "²")
str = Replace(str, "%B3", "³")
str = Replace(str, "%B4", "´")
str = Replace(str, "%B5", "µ")
str = Replace(str, "%B6", "")
str = Replace(str, "%B7", "·")
str = Replace(str, "%B8", "¸")
str = Replace(str, "%B9", "¹")
str = Replace(str, "%BA", "º")
str = Replace(str, "%BB", "»")
str = Replace(str, "%BC", "¼")
str = Replace(str, "%BD", "½")
str = Replace(str, "%BE", "¾")
str = Replace(str, "%BF", "¿")
str = Replace(str, "%C0", "À")
str = Replace(str, "%C1", "Á")
str = Replace(str, "%C2", "Â")
str = Replace(str, "%C3", "Ã")
str = Replace(str, "%C4", "Ä")
str = Replace(str, "%C5", "Å")
str = Replace(str, "%C6", "Æ")
str = Replace(str, "%C7", "Ç")
str = Replace(str, "%C8", "È")
str = Replace(str, "%C9", "É")
str = Replace(str, "%CA", "Ê")
str = Replace(str, "%CB", "Ë")
str = Replace(str, "%CC", "Ì")
str = Replace(str, "%CD", "Í")
str = Replace(str, "%CE", "Î")
str = Replace(str, "%CF", "Ï")
str = Replace(str, "%D0", "Ð")
str = Replace(str, "%D1", "Ñ")
str = Replace(str, "%D2", "Ò")
str = Replace(str, "%D3", "Ó")
str = Replace(str, "%D4", "Ô")
str = Replace(str, "%D5", "Õ")
str = Replace(str, "%D6", "Ö")
str = Replace(str, "%D7", "×")
str = Replace(str, "%D8", "Ø")
str = Replace(str, "%D9", "Ù")
str = Replace(str, "%DA", "Ú")
str = Replace(str, "%DB", "Û")
str = Replace(str, "%DC", "Ü")
str = Replace(str, "%DD", "Ý")
str = Replace(str, "%DE", "Þ")
str = Replace(str, "%DF", "ß")
str = Replace(str, "%E0", "à")
str = Replace(str, "%E1", "á")
str = Replace(str, "%E2", "â")
str = Replace(str, "%E3", "ã")
str = Replace(str, "%E4", "ä")
str = Replace(str, "%E5", "å")
str = Replace(str, "%E6", "æ")
str = Replace(str, "%E7", "ç")
str = Replace(str, "%E8", "è")
str = Replace(str, "%E9", "é")
str = Replace(str, "%EA", "ê")
str = Replace(str, "%EB", "ë")
str = Replace(str, "%EC", "ì")
str = Replace(str, "%ED", "í")
str = Replace(str, "%EE", "î")
str = Replace(str, "%EF", "ï")
str = Replace(str, "%F0", "ð")
str = Replace(str, "%F1", "ñ")
str = Replace(str, "%F2", "ò")
str = Replace(str, "%F3", "ó")
str = Replace(str, "%F4", "ô")
str = Replace(str, "%F5", "õ")
str = Replace(str, "%F6", "ö")
str = Replace(str, "%F7", "÷")
str = Replace(str, "%F8", "ø")
str = Replace(str, "%F9", "ù")
str = Replace(str, "%FA", "ú")
str = Replace(str, "%FB", "û")
str = Replace(str, "%FC", "ü")
str = Replace(str, "%FD", "ý")
str = Replace(str, "%FE", "þ")
str = Replace(str, "%FF", "ÿ")
str = Replace(str, "+", " ")
URLDecode = lCase(str)
End Function
Business Accounts
Answer for Membership
by: b0lsc0ttPosted on 2006-09-14 at 14:31:50ID: 17524591
bschwarting,
Response.Write ADDR1 to confirm that it contains a pound sign before you try to replace. Then use a response.write for the results. What does happen? Are you getting an error or just no change to the value?
Let me know if you have any questions or need more information.
b0lsc0tt