Xu Wei Jie Posted March 14, 2009 Share Posted March 14, 2009 I have a question. Wonder if you all can help. If I have a php script "a" that uses system to call php script "b" i.e. <?php system("php b.php",$retval); ?> How do I get script a's file and directory address using php ? Any idea? I need to know this to manipulate relative addresses involved with the calling script. TIA Note: getting the current working address won't work because I can be invoking script a with a relative address. Link to comment https://forums.phpfreaks.com/topic/149371-getting-a-file-address/ Share on other sites More sharing options...
kenrbnsn Posted March 14, 2009 Share Posted March 14, 2009 What do you mean by "script's address?" Ken Link to comment https://forums.phpfreaks.com/topic/149371-getting-a-file-address/#findComment-784519 Share on other sites More sharing options...
Xu Wei Jie Posted March 14, 2009 Author Share Posted March 14, 2009 Actually I found a solution @ http://www.plus2net.com/php_tutorial/script-self.php However, it still does not work for me as I cannot incrementally build a path based on the trace of the calling scripts. This method only let me retrieve the current calling script's file name and directory address which was what I meant. However, it does not let me know about the the address of previous calling script that calls the current calling script and etc. Hope you are not lost. Link to comment https://forums.phpfreaks.com/topic/149371-getting-a-file-address/#findComment-784524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.