[WEB4LIB] Re: IP Address Detection

Karen Harker Karen.Harker at UTSouthwestern.edu
Thu Nov 8 18:30:57 EST 2001


Of course, this does not take into account multiple ranges.  That is why we were forced to use a database.




Karen R. Harker, MLS
UT Southwestern Medical Library
5323 Harry Hines Blvd.
Dallas, TX  75390-9049
214-648-1698
http://www.swmed.edu/library/

>>> Araby Greene <araby at unr.edu> 11/8/01 4:58:58 PM >>>
This may not be applicable to your situation, but with IIS and ASP, you can
get the visitor's IP address using:

Request.ServerVariables("REMOTE_ADDR")

To detect if the person is on campus, you might extract the first part of
the address:

strUserIP = (Left(Request.ServerVariables("REMOTE_ADDR"),8))
If (strUserIP = "134.197.") Then
    strUserLoc="OnCampus"
Else
    strUserLoc="OffCampus"
End If

In a Perl script, you could use:  $ip = "$ENV{REMOTE_ADDR}";

Hope this helps,
Araby Greene
________________________
Araby Greene
araby at unr.edu
Web Development Librarian
Getchell Library/322
Univ. of Nevada, Reno
http://www.library.unr.edu/


----- Original Message -----
From: "Donald Barclay" <dbarclay at library.tmc.edu>
To: "Multiple recipients of list" <web4lib at webjunction.org>
Sent: Thursday, November 08, 2001 1:45 PM
Subject: [WEB4LIB] IP Address Detection


> Anyone know of a quick, cheap, and good way to detect a site visitor's IP
> address and, based on this, direct them to a particular page on your site?
>
> Donald A. Barclay
> Assistant Director for Systems and Informatics
> Houston Academy of Medicine--
> Texas Medical Center Library
> dbarclay at library.tmc.edu <mailto:dbarclay at library.tmc.edu>
> 713.799.7120
>
> always the beautiful answer
> who asks a more beautiful question
>                  --e.e. cummings



*********************************************************************
Due to deletion of content types excluded from this list by policy,
this multipart message was reduced to a single part, and from there
to a plain text message.
*********************************************************************


More information about the Web4lib mailing list