cristopher evangelista cristopher evangelista - 6 months ago 36x
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


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";  ?>