Hi; I believe I have run up against one of the many things I don't understand about servers.
BACKGROUND
Okay....I have an survey script that is located at the following url (slightly faked)
http://www.blahblahfakeurl.com/survey/survey1.htm
What appears in the browser url window when I actually go there is this:
http://www.blahblahfakeurl.com/survey1?path=/survey/
ACTUALLY, the .htm file is located in a subdirectory of /survey called /html, but there is something I don't understand about this, since the correct URL to actually us it is the one above and the following link does not work
http://www.blahblahfakeurl.com/survey/html/survey1.htm
PROBLEM
I want to be able to use the opendir() function to get a list of .dat files that live in another subdirectory of /survey called /data however, providing the value "data" in the $dir variable in the following function (or some variation with slashes and periods and all that) never seems to get me into that subdirectory, but leaving $dir=""; (empty) WILL very nicely allow me to see the files in the /html subdirectory.
function directory($dir,$filters)
{
$handle=opendir($dir);
$files=array();
if ($filters == "all"){while(($file = readdir($handle))!==false){$files[] = $file;}}
if ($filters != "all")
{
$filters=explode(",",$filters);
while (($file = readdir($handle))!==false)
{
for ($f=0;$f<sizeof($filters);$f++):
$system=explode(".",$file);
if ($system[1] == $filters[$f]){$files[] = $file;}
endfor;
}
}
closedir($handle);
return $files;
}
There is something sophisticated going on here that I do not understand.