How do I put the "logged in username" into a php form field?
For testing I tried this from the online manual at: http://www.php.net/manual/en/reserved.v ... onment.php
Code: Select all
<?php
echo 'My username is ' .$_ENV["USER"] . '!';
?> However, from a cmd prompt (Windows 7) echo %username% correctly displays the logged in user.
Similarly I would like to capture the IP.
I see these done at many sites, but seem to be unable to find the solution.
Shouldn't I be able to set a PHP variable equal to an Environment variable?