472,133 Members | 1,014 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

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 41379
>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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.