473,414 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 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 41539
>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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jim Scheffler | last post by:
I'm new to VB.NET programming and would like some help on a little project I've got going. How would I go about getting computer information on my local computer, i.e. serial number, hard drive...
4
by: Dr. StrangeDub | last post by:
Leaving network identification/DNS out of the picture, how does one change the name of a computer in a local Workgroup (in C#)? I implemented the SetComputerName() API call and that only seems to...
5
by: z. f. | last post by:
i need to get the computer name from an aspx page. i use System.Windows.Forms.SystemInformation.ComputerName() and it's working fine, but in second thought, it might not be recomended to use the...
0
by: Daylor | last post by:
hi. i have app that im developing in my computer with vs.net 2003 (offcourse). now, this app is running in other computer in the local intranet. in the other computer i dont have vs.net installed...
5
by: ThunderMusic | last post by:
Hi, I want to find the computer name and the company name from the network indentification informations. For the computer name, I found System.Net.Dns.GetHostName(), but I fgound nothing for...
6
by: Spyder | last post by:
When you go to "MyComputer" and get properties and select "Computer Name", you get the Domain or Workgroup a computer belongs to. I have looked thru MSDN library, the Internet, the Registry and in...
1
by: Lamis | last post by:
HI, I need to install a service that changes Host Name, computer name, on all our machines. I have tried to ways: First one: static void RenameHostName() { ManagementClass mComputerSystem =...
2
by: Vincent | last post by:
I have been trying to find some API routines that will allow me to determine the name of the computer that is accessing a file on a server. I have found the NetFileEnum call (returns the names of...
7
by: =?Utf-8?B?TWljaGFlbCBkZSBWZXJh?= | last post by:
to all, I was wondering if anyone has sample code that I can use to get information about a computer in active directory. For example, I want to know the date to when a computer was joined to a...
0
by: BrianT | last post by:
I'm trying to build code that allows the computer name to be changed, then asks the user to reboot to make the change affective. I got the code working when logged in as the local computer...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.