473,847 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i need to get the client's computer name using php.

5 New Member
Dear Sir,

i need to get the client's computer name using php.
i tried some code like as below. but i get only client public ip or server information.
so can anyone help me to get client's infiormation.

Expand|Select|Wrap|Line Numbers
  1. echo php_uname();
  2. echo php_uname(Ďní);
  3. $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  5. echo $hostname
Faruk Chowdhury.
Aug 1 '10 #1
5 18516
6,050 Recognized Expert Expert
You can't.

PHP runs on a server, and, by definition, has little to do with a client visiting that server.
Aug 1 '10 #2
5 New Member
do you have any other solution to regarding this problem?
Aug 1 '10 #3
1,168 Recognized Expert Top Contributor
You see the problem is that the internet and websites are mostly controlled by the users browser. Ultimately, you can send someone any bit of code, but if their browser can't interpret and/or run it, it will not work (hence why we hate IE so much). Although I have never tried it, you will need a client side language like javascript to attempt it. However, I think that javascript would run into restrictions because the computer might not give the browser the name to give to your script (for security reasons). In which case you will need to go to something like ASP which was made my Microsoft and has a bit more features. Communication back to PHP will be another hurdle you will have to jump after you achieve that.

Have you considered that people may not want to give you their computer name?
Aug 1 '10 #4
5,058 Recognized Expert Expert
Have you considered that people may not want to give you their computer name?
This is the most important part in a discussion like this. You are given a very limited ability to discover details about your visitors for a reason: security. If any web server could load details about their clients, such as details about their network setup, it would make it that much easier for them to mount malicious attacks, or violate their user's privacy.

If you want such details about a client, you will need to get them through a client-side application. For that you need languages like Java to be installed on the client, which gives you the ability to *request* permission to access the client file system or execute system commands. The user can still deny you access, though.
Aug 1 '10 #5
5 New Member
Thanx to all..
Aug 3 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Maverick | last post by:
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
by: Matt | last post by:
Hi everybody, does anyone know how to retrieve the computer name using ASP? cheers...
by: TIML | last post by:
I have tried using servervariables("XXX") to request the username and computer name of the individual running code on our internal server, but what I want and can't seem to capture is the user's network logon and computer name. The user's logon anonymously. Server: Windows 2000 Workstations: Windows XP Tim
by: RR | last post by:
I'm developing a web app and, for the user's convenience, I'd like to display their local computer name (i.e. the name of the computer the browser is running on). I've looked very hard to find a script that will deliver this and I've also tried some VBScript (which I know nothing about). I found a script that did this: var oShell = new ActiveXObject("Shell.Application");
by: Dan Nash | last post by:
Heylo I want to be able to get the computer name from my C# page. Is this possible? Basically, I'm developing a auto-bugreport feature for an intranet and want to know which machine sent the report. All machines are listed on the workgroup and in AD. Any suggestions? Cheers
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 system.windows.forms.dll inside an asp-dot-net code. any information here will help. TIA, z.
by: =?Utf-8?B?QkRSaWNoYXJkc29u?= | last post by:
I am aware that is is possible to determine the web client computer name using DNS, i.e. invoke System.Net.Dns.GetHostEntry( System.Web.HttpRequest.UserHostAddress). However, this only seems to work if the client computer resides within the same domain as the web server. Is it possible to determine the computer name for a web client which resides in a different domain to the web server?
by: VinayKumarParakoti | last post by:
Hi All, I am trying to get the login name of client's machine using Perl. I was under impression that getlogin() will do the job. But this is not giving correct results. Could anypne please help me in finding solution for the same. Thanks in advance.
by: mitja | last post by:
Hi, I have read a lot of posts on the web and got no answer. Is there any chance of geting any unique client identification data (his IP-but not proxy IP or router or NAT, his username, his computer name, anything) to know from where is the user accesing my aspx page. I have to get some identfication to know on which computer in my company is user working. It would be easy if thet would be just intranet (REMOTE_HOST ), but I have some...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.