IP address & DNS name

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
sharyn
Forum Commoner
Posts: 33
Joined: Tue Jun 15, 2004 6:39 pm
Location: So Cal

IP address & DNS name

Post by sharyn »

I'm looking for a script to find an ip address and the associated DNS name. much like this : http://www.webyield.net/domainquery.html Can this be done in php? or Javascript? if not, what can I do this in? I need to be able to log visitors to my site and see where they are from.

Thanks, sharyn
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

http://php.net/manual/en/function.gethostbyaddr.php
http://php.net/manual/en/function.gethostbyname.php

Also see $_SERVER['REMOTE_ADDR'] to get the IP address of the remote user.
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

PHP would be the best option. From what I have learned, javascript does not hold the right resources for that.
Post Reply