Forum Moderators: coopster

Message Too Old, No Replies

Finding a computer's name

         

ahmedtheking

10:17 am on Jun 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possible, maybe not through PHP but let's find out, to find a computer's name? By name, I'm referring to its 'subnet name'. (Yeah I understand the meaning of subnet, but is there a way, maybe through JavaScript?)

Habtom

11:01 am on Jun 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The online manual shows this should work:

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

Let me know.

Habtom

phranque

11:02 am on Jun 5, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



it is possible with ActiveX and low browser security settings...

phparion

11:14 am on Jun 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



On internet it might not be possible to fetch exact computer name however on intranet try this

<?php

echo php_uname('n');

?>

Habtom

11:17 am on Jun 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



// php_uname — Returns information about the operating system PHP is running on

That is from the manual.

Habtom