Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

url escape characters

Status
Not open for further replies.

malonep

Programmer
Jul 14, 2004
44
CA
I am trying to pass a string with special characters to another page.

I build my next page and pass it in the string
"details.asp?caption=!%40%23%24%25%5E%26*()". When I link to that page the url of that page will show in the address bar as "details.asp?caption=!@#$%^&*()" and when I try to show the "caption" string it only shows as !@

Why is my browser (IE or Netscape) converting the url page to the regular symbols? How do I force it to show !@#$%^&*()

(Although an extreme example it would be the main symbols that this string could contain)


Thanks,
malonep
 
I go
Code:
      strCaption = Request.QueryString("caption")
      %>

      <tr>
        <td>Name: </td>
        <td><%=strCaption%></td>
      </tr>

when the addressbar shows !@#$%^&*() I only see !@ but, if I type into the address bar !%40%23%24%25%5E%26*() I will see the whole string
 
so why not use the HTML encoded strings???

Known is handfull, Unknown is worldfull
 
what is HTML encoded strings and how do I use them?
 
!%40%23%24%25%5E%26*()

%40 is a HTML Query string equivalent to @,similarly the other characters.

how are u passing the variables? using javascript???

Known is handfull, Unknown is worldfull
 
on the main page I go in javascript (for debugging it is actually the following line)
Code:
window.open("details.asp?caption=!%40%23%24%25%5E%26*()","Details");

and when I link to the the details.asp page the url shows

and I show it by
Code:
strCaption = Request.QueryString("caption")
      %>

      <tr>
        <td>Name: </td>
        <td><%=strCaption%></td>
      </tr>

if on the details page I manually change the url in the address bar to be and press enter then the proper string shows in its entirety

Both Netscape and IE seem to be replacing my string with %34 etc. to show the symbols.
 
TheCaption="!%40%23%24%25%5E%26*()"
TheCaption=urlencode(TheCaption)
window.open("details.asp?caption="+TheCaption,"Details");


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top