Connecting Tech Pros Worldwide Forums | Help | Site Map

(Request.ServerVariables("HTTP_REFERER")

Newbie
 
Join Date: Jan 2008
Posts: 2
#1: Jan 2 '08
how do i go about this, wit the aim of restricting access to a page.

If Instr(Request.ServerVariables("HTTP_REFERER"),"pag e_name") Then





thanks

Expert
 
Join Date: Nov 2007
Posts: 126
#2: Jan 2 '08

re: (Request.ServerVariables("HTTP_REFERER")


Quote:

Originally Posted by kennyzita

how do i go about this, wit the aim of restricting access to a page.

If Instr(Request.ServerVariables("HTTP_REFERER"),"pag e_name") Then

You pretty much have it right there, minus a vital part of the syntax for the Instr() function. The Instr() function doesn't return a boolean value, rather it returns NULL or some integer because it is identifying where in a string a substring begins.

Expand|Select|Wrap|Line Numbers
  1. if Instr(Request.ServerVariables("HTTP_REFERER"),"your_URI") < 1 then
  2.    '// insert code that denies access, or redirects
  3. end if
  4.  
Reply