• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 882
  • Last Modified:

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)
%>
============================================================
0
sixdegree
Asked:
sixdegree
1 Solution
 
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
 
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now