How to grab computer name
Moderator: General Moderators
How to grab computer name
Was wondering how would I got about grabbing the clients computer name and displaying on the same page. This is for a intranet site for work, thanks. 
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Maybe try gethostbyaddr() if this is intranet it may work 
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: How to grab computer name
I'm not too sure what the code is, but make it so it traces their C drive and goes to the following route: C:\Documents and Settings
Then make it so it chooses a username other than Administrator, Default User, All Users or Guest.
Or if it's possible make it check the start bar's explorer and make it trace which folder was automaticaly opened..because it always opens the current user's account..
Then make it so it chooses a username other than Administrator, Default User, All Users or Guest.
Or if it's possible make it check the start bar's explorer and make it trace which folder was automaticaly opened..because it always opens the current user's account..
gethostbyaddr
I used the example:
<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $hostname;
?>
I get a "localhost" as a response. Hrm... must be missing something because that is not my computer name. Am I using the "gethostbyaddr" command correctly?
<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $hostname;
?>
I get a "localhost" as a response. Hrm... must be missing something because that is not my computer name. Am I using the "gethostbyaddr" command correctly?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: How to grab computer name
PHP will never access somebody's PC and invade their privacy in such a way as this. If somebody could get into my documents and settings remotely I'd be a bit worried. Besides... I use LinuxFTJoe wrote:I'm not too sure what the code is, but make it so it traces their C drive and goes to the following route: C:\Documents and Settings
Then make it so it chooses a username other than Administrator, Default User, All Users or Guest.
Or if it's possible make it check the start bar's explorer and make it trace which folder was automaticaly opened..because it always opens the current user's account..