Altec Posted June 1, 2009 Share Posted June 1, 2009 I need to find the absolute path of a directory higher than the one my script runs in. For example: I'm in: /public_html/community/admin/ I need to upload to: /public_html/community/inc/plugins This needs to run on pretty much any server (I'm developing a plugin for a forum software package). I'm not sure how to do this. Any help is greatly appreciated. Steven Link to comment https://forums.phpfreaks.com/topic/160439-get-path-of-higher-directory/ Share on other sites More sharing options...
Ken2k7 Posted June 1, 2009 Share Posted June 1, 2009 $upload_dir = '../inc/plugins/'; Link to comment https://forums.phpfreaks.com/topic/160439-get-path-of-higher-directory/#findComment-846670 Share on other sites More sharing options...
anupamsaha Posted June 1, 2009 Share Posted June 1, 2009 I need to find the absolute path of a directory higher than the one my script runs in. For example: I'm in: /public_html/community/admin/ I need to upload to: /public_html/community/inc/plugins This needs to run on pretty much any server (I'm developing a plugin for a forum software package). I'm not sure how to do this. Any help is greatly appreciated. Steven $upload_dir = realpath(dirname(__FILE__) . '/..'); Link to comment https://forums.phpfreaks.com/topic/160439-get-path-of-higher-directory/#findComment-846676 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.