I have no idea if this is possible
I have found that when you log on to your ISP you are given a sort of virtual domain mapped to your IP address. This "virtual domain" is in the form dial-up3030.cva.dublin.eircom.net or something like that.
Is there any way in PHP of getting this address off a visitor to you site in the way that you can get their IP address?
Thanks
Getting IP addresses
Moderator: General Moderators
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
Not sure I'm following.....
Hey G,
Cheers,
BDKR
You should be able to get this information using gethostbyaddr(). Just pass it the IP address and it is supposed to grab this information for you if at all possible.Is there any way in PHP of getting this address off a visitor to you site in the way that you can get their IP address?
Cheers,
BDKR
mydimension gave ya the easy answer... and there are quite a few more that tend to be useful.mydimension wrote:it is contained in $_SERVER['REMOTE_ADDR']
Code: Select all
<?php
$_SERVERї"HTTP_UA_CPU"];
$_SERVERї"HTTP_UA_OS"];
$_SERVERї"HTTP_USER_AGENT"];
$_SERVERї"REMOTE_ADDR"];
$_SERVERї"REMOTE_PORT"];
$_SERVERї"PATH_TRANSLATED"];
$_SERVERї"QUERY_STRING"];
$_SERVERї"REQUEST_METHOD"];
$_SERVERї"SERVER_NAME"];
$_SERVERї"SERVER_PORT"];
$_SERVERї"SERVER_ADDR"];
$_SERVERї"HTTP_HOST"];
$_SERVERї"HTTP_ACCEPT_LANGUAGE"];
?>Web: http://www.php.net/manual/en/reserved.variables.php
Remember, php.net is your friend.
It's really a matter of if the Host name is set in the machine you are interested in. That said, if the Host name isn't set in the first place, there is no host name to get. There is nothing you can do about that short of sending someone an email and telling them to set one.ozmodiar wrote: gethostbyaddr() worked, but only for certain IP addresses. Obviously not all ISP's have this service.
Cheers,
BDKR