|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
URLs in the query string
I need to pass a URL as a value in a query string.
The problem is, some of the URLs have query strings of their own, so it confuses the script... for instance url to be included: http://www.domainA.com/index.asp?var=99&num=88 url that is confused: http://www.domainB.com/index.asp?ur...p?var=99&num=88 the script thinks that the url value stops after 99, but it should include 88 How can I encode this, or rewrite it in such a way that it fools the script or otherwise works? Anybody else have this problem? Thanks! B |
|
#2
|
|||
|
|||
|
server.UrlEncode
You could try to use the URLEncode method of the ASP server elment. Do not 100% know if this will work, but you could give it a spin
Code:
<% Response.Write "http://www.domain1.com/index.asp?var=" & _
Server.URLEncode("http://www.domain2.com/index.asp") %>
__________________
- Rogier Doekes |
|
#3
|
|||
|
|||
|
I tried this as well, but it does the same thing.
|
|
#4
|
|||
|
|||
|
The QUERY_STRING Server Variable will give you the whole querystring as a string. You can then parse it for the values you need..?
[CODE] <% dim strURL strURL = Replace(Request.ServerVariables("QUERY_STRING"),"url=","") Response.Write(strURL) %> [CODE] |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > URLs in the query string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|