Results 1 to 2 of 2

Thread: HTTP_REFERER Question

  1. #1
    Alex T. Guest

    Default HTTP_REFERER Question

    Okay, I have this little form that writes information to the database. However, I want users to go back to the page which they came when they entered the information. The URL of the previous page is a query string (like How do I use the HTTP_REFEER to go back to that page? Currently I have error checking in the page, so the last part of it looks something like this:<BR><BR>&#060;%Else%&#062;<BR>Your infomration was entered correctly!<BR>&#060;%End If%&#062;<BR><BR>How do I get it to go back to the previous page? Thanks in advance!!!

  2. #2
    Join Date
    Dec 1969

    Default RE: HTTP_REFERER Question

    Well, since you can&#039;t use Response.Redirect and also show the user that "entered correctly" message, you are limited in your choices.<BR><BR>You could put a META-REFRESH into the header, so that after the user sees the message for a few seconds he is headed back.<BR><BR>Or you could simply put an &#060;A HREF=...&#062; link that he clicks on to return to the prior page (this is what most sites do).<BR><BR>SO:<BR><BR>&#060;%<BR>temp = Request.ServerVariables("HTTP_REFERER")<BR>temp = Left( temp, InStr( temp, "?" ) - 1 ) &#039; lop off the query string<BR>temp = "http://" & temp &#039; is this needed???<BR>%&#062;<BR><BR>&#060;A HREF="&#060;% = temp %&#062;"&#062;Go back to previous page&#060;/A&#062;<BR><BR>By the way, what does this have to do with databases???<BR><BR>

Posting Permissions

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