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:
  1. $username = $_ENV["COMPUTERNAME"]; //set variable
  2. echo $username; //show the value of the variable
  3. ?>

I hope somebody finds it helpful.

VN:F [1.9.3_1094]
Rating: 1.5/10 (2 votes cast)
VN:F [1.9.3_1094]
Rating: -2 (from 2 votes)
Current user’s machine name, 1.5 out of 10 based on 2 ratings
Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists

3 Comments

  1. Does not work.

    VA:F [1.9.3_1094]
    Rating: 5.0/5 (2 votes cast)
    VA:F [1.9.3_1094]
    Rating: +1 (from 1 vote)
  2. I like this post. It’s more along the lines of the stuff that I write about on my blog.

    VA:F [1.9.3_1094]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.3_1094]
    Rating: 0 (from 0 votes)
  3. Abdul

    Thank you, and what didn’t work??

    can I see your code?

    VN:F [1.9.3_1094]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.3_1094]
    Rating: 0 (from 0 votes)

Leave a Reply