469,268 Members | 920 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,268 developers. It's quick & easy.

Is there a way to get Computer Name in php ?

I'm trying to get the " Computer Name " of a client accessing my web
site,
is there a way to do this ? not ip...

tia

Jul 17 '05 #1
5 41015
>I'm trying to get the " Computer Name " of a client accessing my web
site,
is there a way to do this ? not ip...


What's a "Computer Name"? If it's the DNS name, you could try
taking the IP and doing a reverse DNS lookup on it (gethostbyaddr()).
That may fail, though, especially for ISPs with large banks of
dialup lines where they don't bother.

If "Computer Name" is some kind of Windows-only thing, expect problems
with non-Windows systems.

Gordon L. Burditt
Jul 17 '05 #2
On Thu, 07 Jul 2005 15:40:12 -0700, Maverick wrote:
I'm trying to get the " Computer Name " of a client accessing my web
site,
is there a way to do this ? not ip...

tia


This is what you need:

$box=php_uname('n');

--
http://www.mgogala.com

Jul 17 '05 #3
>> I'm trying to get the " Computer Name " of a client accessing my web
site,
is there a way to do this ? not ip...

tia


This is what you need:

$box=php_uname('n');


This gives no information about the *CLIENT* whatever.
It gives information on the SERVER.

Gordon L. Burditt
Jul 17 '05 #4
On Fri, 08 Jul 2005 03:27:41 +0000, Gordon Burditt wrote:
I'm trying to get the " Computer Name " of a client accessing my web
site,
is there a way to do this ? not ip...

tia


This is what you need:

$box=php_uname('n');


This gives no information about the *CLIENT* whatever.
It gives information on the SERVER.

Gordon L. Burditt


You are right, I should have read it more carefully. Fortunately, there
is an example in the manual page. This is cut & paste from the online
manual:

<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

echo $hostname;
?>
--
http://www.mgogala.com

Jul 17 '05 #5
I tried this method, using gethostbyaddr, its good but it is too slow
and it takes time for the page to load.

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jim Scheffler | last post: by
5 posts views Thread by z. f. | last post: by
5 posts views Thread by ThunderMusic | last post: by
6 posts views Thread by Spyder | last post: by
1 post views Thread by Lamis | last post: by
7 posts views Thread by =?Utf-8?B?TWljaGFlbCBkZSBWZXJh?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.