Sorry I am not sure I understand what you are asking ( or perhaps how header works) but my issue is that I also want to call the same file getimages.php and it needs to load the files from the location of the calling index.html.
So if index.html is in ../gallery/ then run get images from ../gallery. If index.html is in ../gallery2/ then it should get the images from gallery 2 etc.
So my side structure is more complex than this, and looks more like:
php
- getimages.php
2002
- 01gallery
- index.html
- image1.jpg
- image2.jpg
- 01gallery
- index.html
- image1.jpg
- image2.jpg
- 02gallery
- index.html
- image1.jpg
- image2.jpg
- 04gallery
- index.html
- image1.jpg
- image2.jpg
etc (for 2003, 2004, ...)
Does that make sense?
I did write this bit of code to get it to work but it seems a bit of an overkill:
- function getcallingdir(){
-
-
$callingdir= strstr($_SERVER[HTTP_REFERER],$_SERVER[HTTP_HOST]);
-
$callingdir = str_replace($_SERVER[HTTP_HOST],$_SERVER[DOCUMENT_ROOT],$callingdir);
-
$callingdir = trim(str_replace("index.html","",$callingdir));
-
-
return $callingdir;
-
}
-