cristopher evangelista cristopher evangelista - 2 years ago 148
PHP Question

how to get environment variables desktop path

can someone help me to get DESKTOP PATH?

echo "<input type='hidden' value='C:\Users\".getenv('USERNAME')."\Desktop'>";

it returns C:\Users\IT-TUPER$\Desktop

this is my desktop path C:\Users\Tuper\Desktop

Answer Source

In php by no means you can't have Desktop Path on a real server, as php is serverside. However if you're on localhost like xampp, wamp, or whatever on windows you try this :

<?php  echo getenv("HOMEDRIVE").getenv("HOMEPATH")."\Desktop";  ?>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download