Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: response.redirect and referring URL


Message #1 by jason@u... on Fri, 14 Mar 2003 18:16:26
I have page named "database.asp" using a GET that calls a page 
named "dbauth.asp".  From that page, based on the content of the 
querystring, I'm redirecting users to new site.  Can someone explain why 
the site I'm redirecting to sees my initial page ("database.asp") as the 
referring page and not "dbauth.asp"?  The script still seems to work as I 
expected except for this.

In the example below, DATABASE sends the request to DBAUTH.  DBAUTH 
redirects to databaseA or databaseB.  But, databaseA sees DATABASE as 
referring url, not DBAUTH.

Thanks

DATABASE.ASP
  querystring sent = "http://mysite.com/dbauth.asp?db=a

DBAUTH.ASP
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<% Dim objDBName, strDBName
	If Request.QueryString("db") <> " " Then
		strDBName = Request.QueryString("db")
%>

<% Dim strIPList, strIPUser, strIPTest, arrIP, strIPUserConcat
	strIPUser = Request.ServerVariables("REMOTE_ADDR") 
	strIPUserConcat = Replace(strIPUser, ".", "")
	strIPTest = Left(strIPUserConcat, 8)
	strIP = ("12345678")
%>

<%  Dim strError, strIP
		strError = "" 
		If InStr(strIPTest, strIP) Then
					Select Case strDBName
					Case "a"
					Response.Redirect
("http://databaseA.asp")
					Case "b"
					Response.Redirect
("http://databaseB.asp")
					Case Else			
		                        End Select
                         Else 

                        End If
Next		


Else

End If
%>

  Return to Index