Checking to see if a referring url/link matches

  • Thread starter Chumley the Walrus
  • Start date
C

Chumley the Walrus

I know I've used something like this in the past, can't put my finger
on it, tho...
I need to find out the method/keyword for checking to see if a user is
clicking into one webpage from a certain other webpage or url:

hypothetical example:
<%if referringurl = "http://www.yahoo.com" then

'do a function or task

end if%>

What would be the keyword or method/function for "referringurl" in the
above example?

Thanks
Chum
 
S

Steven Burn

Function CheckReferer(sWhat, sMatch)
Select Case sWhat
Case sMatch
CheckReferer = True
Case Else
CheckReferer = False
End Select
End Function

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
S

Steven Burn

Forgot to add, to use the function, you'd simply do;

<%
If CheckReferer(Request.ServerVariables("HTTP_REFERER"),
"http://www.yourdomain.com") Then
Response.Write "Yipee, they match"
Else
Response.Write "Oh dear, they don't match"
End If
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
E

Evertjan.

Steven Burn wrote on 01 jul 2004 in
microsoft.public.inetserver.asp.general:
Function CheckReferer(sWhat, sMatch)
Select Case sWhat
Case sMatch
CheckReferer = True
Case Else
CheckReferer = False
End Select
End Function

Wouldn't that be the same as:


Function CheckReferer(sWhat, sMatch)
CheckReferer = (sWhat = sMatch)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top