Ok, I will do my best to try and explain what I am trying to accomplish.
I'll try to give you all the information even if it's void. 🙂
I have a $site_root variable in a php script. Every php script includes ($site_root . 'common.php'
No, this is not phpbb.. I just use some of there ideas. 🙂
I want to get a redirection thing going so that when I redirect it takes the visitor back to the same page.
In the common.php file so far I have gotten this:
$this_redirect = '?' . SID . '&redirect=' . ($site_root . basename($_SERVER['SCRIPT_NAME']));
That will set redirect to equal something like ./index.php
The problem with this I noticed though is say I have a script, photoalbum/index.php
That script/file is relative to the website root.
This script would also include the $site_root variable and include the common.php script
that would also produce a redirect equal to something like ./index
which would just redirect to the website root's index, instead of ./photoalbum/index.php
See what I am saying? That's where I need to figure out how to get the directory path starting at the website root. Do you know how I could do this?
Thanks, mike.