Solved

if request null redirect http referrer

Posted on 2011-03-13
5
792 Views
Last Modified: 2012-05-11
Hello, is this coded correctly /will it work --

(asp vb script)

thanks -

<% If Request("femail") NULL then Response.Redirect(Request.ServerVariables("HTTP_REFERER")) %>
0
Comment
Question by:garethtnash
  • 3
5 Comments
 
LVL 28

Accepted Solution

by:
sammySeltzer earned 250 total points
ID: 35123315
Should be something like:

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

Open in new window

0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 125 total points
ID: 35123523
assuming they have been set
referrer is not set when you load a url from the location bar or from bookmark
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 35124286
good point
0
 
LVL 22

Assisted Solution

by:neeraj523
neeraj523 earned 125 total points
ID: 35128083
Better to use it in this way


<%
If Request("femail") = "" Then
   If Request.ServerVariables("HTTP_REFERER") <> "" Then
     Response.Redirect(Request.ServerVariables("HTTP_REFERER"))
   Else
     Response.Write "Invalid access."
  End if
End if
%>
0
 
LVL 28

Assisted Solution

by:sammySeltzer
sammySeltzer earned 250 total points
ID: 35128383
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>
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question