Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

if request null redirect http referrer

Posted on 2011-03-13
5
Medium Priority
?
807 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 1000 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 500 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 29

Expert Comment

by:sammySeltzer
ID: 35124286
good point
0
 
LVL 22

Assisted Solution

by:neeraj523
neeraj523 earned 500 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 29

Assisted Solution

by:sammySeltzer
sammySeltzer earned 1000 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

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!

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
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)

609 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