Home > ASP Development > HTTP_REFERER Trouble

HTTP_REFERER Trouble



I've written an application that makes use of the HTTP_REFERER server variable to redirect users to a page they just came from. This has worked for everyone that's used the application except one person where they get the following error:



Response object error 'ASP 0158 : 80004005'



Missing URL



/admin_dbupdate.asp, line 10



A URL is required



Any ideas why this is happening??

    
Guest


HTTP_REFERER is blank, you need to check to see if its blank usally using the following would do the trick.

Code:


	Dim strReferer
strReferer = Request.ServerVariables("HTTP_REFERER")
If Len(strReferer) = 0 Then
Response.Redirect("Default.asp")
Else
Response.Redirect(strReferer)
End If



Was this answer helpful ? Yes No   
Guest


Some firewall software like Norton Internet Security can block http referer from the server, as can some proxy servers.

Was this answer helpful ? Yes No   
Guest


Thanks guys. I will put in some validation to check if HTTP_REFERER is blank and I will also ask the guy if they are running any sort of Internet Security products which may block HTTP_REFERER.

Was this answer helpful ? Yes No   
Guest


If these are pages on your server then you could setup a function to set the current page and the last page so you will always have a record of where the user came from and can redirect them back.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved