NamePros.Com (http://www.namepros.com/)
-   Webmaster Tutorials (http://www.namepros.com/webmaster-tutorials/)
-   -   Current user's machine name (http://www.namepros.com/webmaster-tutorials/173490-current-users-machine-name.html)

asgsoft 03-04-2006 01:33 PM

Current user's machine name
 
While looking in the PHP predefined variables i found an intersting one: $_ENV["COMPUTERNAME"]. what this does is it gives the current username of the person viewing your site. This is quite good if you are making a poll for a intranet where each user has their own username.

Have a look at this and tell me what you think.

PHP Code:
<?php
$username
= $_ENV["COMPUTERNAME"]; //set variable

echo $username; //show the value of the variable

?>

I hope somebody finds it helpful.

ASGSOFT

MasterB 03-11-2006 11:52 AM

Actually, this displays the computer name of the computer which the server is on. Your computer name doesn't get transmitted through the headers (as far as I know).

.PJ 03-11-2006 01:35 PM

Im finding this doesnt work on my web server but only on my localhost server so MasterB is correct.

PJ

2knew 03-18-2006 01:29 PM

Try this:

echo gethostbyaddr($_SERVER['REMOTE_ADDR'])."<br/>\n";

It'll give what is essentially your point of access to the internet through your ISP, but not your actual machine name. I do not believe your true host name is ever routed (unless perhaps you have a direct connection to the internet like some edu workstations...)

bbalegere 03-23-2006 09:19 PM

How exactly does this script help?
Where can we use it?

-Ray- 04-01-2006 02:19 PM

If it told a username.. it makes the person more easy to hack...


All times are GMT -7. The time now is 04:21 AM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0