Response Redirect Semicolon Problem

When I do the below code, ASP is taking out the semicolons and going to:

http://z1.adserver.com/w/cp.x%3Bmid%3D15664%3Brid%3D322%3Btid%3D3%3Bev%3D2%3Bdt%3D3%3Bac%3D76%3Bc%3D71%3B

I need the semicolons to stay.  Please help.

============================================================
<%
url = "http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;"
response.redirect(url)
%>
============================================================
sixdegreeAsked:
Who is Participating?
 
leos_Commented:
sixdegree,

This was a hard problem, and I think the problem is in "response.redirect" automatically running a urlencode.

When you use response.redirect what actually happens is a HTTP 302 response header is sent to the browser telling the browser that the web page has moved.  For quite a while browsers automatically redirects the user to the new location.  To the user it seems like the page redirect is done on the server side.  In anycase, if you simulate the http 302 response it solves your problem.

Here is the code:

<%

url = "http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;"

Response.Status = "302 Object Moved"
Response.AddHeader "Location", url
Response.Write "<HTML>"
Response.Write "<BODY>"
Response.Write "This file was moved to "
Response.Write "<A HREF=""" & url & """>here.<A>"
Response.Write "</BODY>"
Response.Write "</HTML>"
Response.End

%>

and if you want to, you could write your own function called ResponseRedirect(url) which would call that.

hmm.
0
 
aprestoCommented:
semi colons are invalid in the url,

why do you need them, maybe you can replace them with another character and convert them back at serverside?

what are they for?
0
 
aprestoCommented:
or just use & if you want to seperate the variables, are they variables and valu key pairs?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sixdegreeAuthor Commented:
They're not invalid.  If you copy/paste it into your address browser it works perfectly fine.

http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;
0
 
aprestoCommented:
sorry i didnt mean invalid, but if you parse them with asp they are converted.

why dont you try and wrap this around it.

server.URLencode()
0
 
sixdegreeAuthor Commented:
This is the page i'm working with:

http://register01.playbingolive.com/upsellit.asp?do=register

it redirects using:

url = "http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;"
response.redirect(server.URLencode(url))

Which doesn't work either.

0
 
deighcCommented:
Try:

url = "http://z1.adserver.com/w/" & Server.URLEncode("cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;")
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.