Solved

if request null redirect http referrer

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

Independent Software Vendors: 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

Suggested Solutions

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

726 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