The place that has your tutorials

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

I hope somebody finds it helpful.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists

Leave a Reply