Redirect problems

Results 1 to 2 of 2

Thread: Redirect problems

  1. #1
    Join Date
    Dec 1969

    Default Redirect problems

    Please could someone point me in the right direction, I want to redirect visitors to a page based on a name the enter into a text box, this works OK if the page exsists <BR>How could I redirect them back to the origional page if the one they enter does not exist (the page&#039s are based in daemon running on NT machines and would only exist if the daemon is running) <BR>Hope I haven&#039t made this too confusing<BR>Thanks<BR>Mark

  2. #2
    Join Date
    Dec 1969

    Default Request.ServerVariables way

    After you do your checking to see if the file is there, then if it is not you can capture where the user came from with:<BR>...<BR>Request.ServerVariables("HTTP_REFE RER")<BR>...<BR><BR>Then use the redirect to send them back. So:<BR>...<BR>Dim PageTheyTyped<BR>Dim whereFrom<BR>PageTheyTyped = Request.Form("page")<BR>whereFrom = Request.ServerVariables("HTTP_REFERER")<BR>If PageTheyTyped False Then<BR>&#039the above line is only pseudocode!<BR>&nbsp;&nbsp;Response.Redirect(where From)<BR>Else<BR>&nbsp;&nbsp;Response.Redirect(Pag eTheyTyped)<BR>End If<BR>...<BR><BR>Hope this helps.

Posting Permissions

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