Jump to content

Getting a file address


Xu Wei Jie

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.