Required From a Particular Page

Results 1 to 2 of 2

Thread: Required From a Particular Page

  1. #1
    Join Date
    Dec 1969

    Default Required From a Particular Page

    I am trying to figure out how to write code that requires a visitor to come from not just 1 page but from either of 2 pages. I saw this done in Javascript to require a user to come from a particular page (see below) but was wondering how I could modify it to allow the user to come from either login_db.asp or ModifyAthleteProfile.asp? Can this also be done in VBScript?<BR><BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR>&#060;!-- Begin<BR>var requiredfrom = "login_db.asp"; // required prev. page<BR>if (document.referrer.indexOf(requiredfrom) == -1) {<BR>alert("You must come to this page from " + requiredfrom);<BR>window.location=requiredfrom;<BR >}<BR>// End --&#062;<BR>&#060;/script&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default Yeah.

    The referrer is made available through the Request.ServerVariables() collection.<BR><BR>Then it&#039;s just If x = "page.asp" Or x = "other.asp" Then...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts