poe Posted November 2, 2007 Share Posted November 2, 2007 is there a way to see the 'name' of my computer? what i mean is, i ran phpinfo() while working on localhost and see under environment it lists USERDOMAIN = 'homecomputer', which i see is the 'name' of this machine i am using? if i run phpinfo() on the wifes laptop while working in localhost USERDOMAIN = 'mylaptop' is there a way in php to go: if (USERDOMAIN = 'homecomputer') { $path = "c:/easyphp/www/poe/myweb/"; } else { $path = "c:/easyphp/www/fromhome/"; } that way, when i copy my entire www directory to my usb key to bring home i dont need to keep commenting out the path when i copy files to bring from home to work and visa versa. thanks chris Quote Link to comment https://forums.phpfreaks.com/topic/75720-pvp-environment/ Share on other sites More sharing options...
MasterACE14 Posted November 2, 2007 Share Posted November 2, 2007 I believe you can use the ini_get() function to grab that specific server setting, and then do the comparing. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/75720-pvp-environment/#findComment-383439 Share on other sites More sharing options...
Barand Posted November 2, 2007 Share Posted November 2, 2007 echo $_SERVER['USERDOMAIN']; Quote Link to comment https://forums.phpfreaks.com/topic/75720-pvp-environment/#findComment-383450 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.