aeroswat Posted June 24, 2010 Share Posted June 24, 2010 It's a SERVER variable I believe that shows the path to the home directory Link to comment https://forums.phpfreaks.com/topic/205784-i-cannot-for-the-life-of-me-remember-this-variable-name/ Share on other sites More sharing options...
ChemicalBliss Posted June 24, 2010 Share Posted June 24, 2010 $_SERVER['DOCUMENT_ROOT']; This will return the full path to the current directory the current top-level script (if includes, then the first script called) that has been called. I suggest getting very intimate with the php manual: http://php.net/manual/en/reserved.variables.server.php Hope this helps, -cb- Link to comment https://forums.phpfreaks.com/topic/205784-i-cannot-for-the-life-of-me-remember-this-variable-name/#findComment-1076862 Share on other sites More sharing options...
aeroswat Posted June 24, 2010 Author Share Posted June 24, 2010 Quote $_SERVER['DOCUMENT_ROOT']; This will return the full path to the current directory the current top-level script (if includes, then the first script called) that has been called. I suggest getting very intimate with the php manual: http://php.net/manual/en/reserved.variables.server.php Hope this helps, -cb- Thanks that's it but it doesn't work for CRON jobs is there anything else I could do that might cover that part in cron jobs? Link to comment https://forums.phpfreaks.com/topic/205784-i-cannot-for-the-life-of-me-remember-this-variable-name/#findComment-1076877 Share on other sites More sharing options...
ChemicalBliss Posted June 24, 2010 Share Posted June 24, 2010 Put the server path in a config variable. I'm afraid this is the only way i know of getting an absolute path with a GLOBAL variable stated. This shouldn't be a problem for a cron job though, even if your uploading to 1000 websites you can make a php script to upload them for you and edit the config file as necessary. -cb- Link to comment https://forums.phpfreaks.com/topic/205784-i-cannot-for-the-life-of-me-remember-this-variable-name/#findComment-1076934 Share on other sites More sharing options...
aeroswat Posted June 25, 2010 Author Share Posted June 25, 2010 Quote Put the server path in a config variable. I'm afraid this is the only way i know of getting an absolute path with a GLOBAL variable stated. This shouldn't be a problem for a cron job though, even if your uploading to 1000 websites you can make a php script to upload them for you and edit the config file as necessary. -cb- Thanks. I have a few more problems to fix in the system before my temporary employment has expired so I don't think I have time to make that universal. I'll do it at home once I'm out. Link to comment https://forums.phpfreaks.com/topic/205784-i-cannot-for-the-life-of-me-remember-this-variable-name/#findComment-1077112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.