if request null redirect http referrer

Hello, is this coded correctly /will it work --

(asp vb script)

thanks -

<% If Request("femail") NULL then Response.Redirect(Request.ServerVariables("HTTP_REFERER")) %>
Who is Participating?
sammySeltzerConnect With a Mentor Commented:
Should be something like:

<% If Request("femail") ="" then Response.Redirect(Request.ServerVariables("HTTP_REFERER")) %> 

Open in new window

Michel PlungjanConnect With a Mentor IT ExpertCommented:
assuming they have been set
referrer is not set when you load a url from the location bar or from bookmark
good point
neeraj523Connect With a Mentor Commented:
Better to use it in this way

If Request("femail") = "" Then
   If Request.ServerVariables("HTTP_REFERER") <> "" Then
     Response.Write "Invalid access."
  End if
End if
sammySeltzerConnect With a Mentor Commented:
He could also user Server.Transfer.

It is actually safer.

One of my least favorites, an option nonetheless, is to use

<a href="javascript:history.go(-1)">GO BACK</a>
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.