Solved

if request null redirect http referrer

Posted on 2011-03-13
5
799 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 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 29

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 29

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

691 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