I've been writing a fault & equipment database at work, and I discovered a PHP function which effectively runs an NSLookup based on the client's IP address.
The returned hostname is then checked in the database to find out which room the user is posting from, allowing the user to report a fault in their room with a single click, rather than looking for their room from a big drop-down box.
I'll put some sample code up on Tuesday when I get back into work.
The PHP command is:
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
No good for internet, but great for intranet scripting.