my friend made me this script (im not very good at php yet) that lists dirs, sets them into one drop down boxas opts, and then when an opt is picked, a new drop down appears beside it and lists the files.. then you select a file and it is displayed (all pictures.) the problem si this doesnt work in netscape. the url for the site is gallery.girlstar.org/main.php
the code is..
<?
include('header.inc');
$basedir = "/var/www/htdocs/gallery/gallery/";
function showdates() {
global $basedir;
global $selecteddate;
$dir = opendir($basedir);
while ($file = readdir($dir)) {
if(is_dir($basedir.$file)) {
$directories[] = $file;
}
}
?>
<SELECT NAME="selecteddate" OnChange="javascript:this.form.submit()">
<OPTION SELECTED>date</OPTION>
<?
reset($directories);
while (list($key, $val) = each($directories)) {
if ($val != "." && $val != "..") {
?>
<OPTION VALUE="<?echo $val?>" <?if($selecteddate == $val) { ?> SELECTED <? } ?>><?echo $val?></OPTION>
<?
}
}
?>
</SELECT>
<?
}
function showfiles($directory) {
global $basedir;
global $selectedfile;
global $selecteddate;
global $oldselecteddate;
if(!($oldselecteddate==$selecteddate)) {
$selectedfile = "";
}
$dir = opendir($basedir.$directory."/");
?>
<SELECT NAME="selectedfile" OnChange="javascript:this.form.submit()">
<OPTION SELECTED>file</OPTION>
<?
while ($file = readdir($dir)) {
if(is_file($basedir.$directory."/".$file)) {
?>
<OPTION VALUE="<?echo $file?>" <? if($selectedfile == $file) { ?> SELECTED <? } ?>><?echo $file?></OPTION>
<?
}
}
?>
</SELECT>
<INPUT TYPE="HIDDEN" NAME="oldselecteddate" VALUE="<?echo $selecteddate?>">
<?
}
function showimage($filename) {
global $basedir;
?>
<SCRIPT LANGUAGE="JavaScript">
parent.window.pics.location.href="showimage.php?filename=<?echo $filename?>";
</SCRIPT>
<?
}
?>
<FORM NAME="images" METHOD=POST ACTION="<?echo $PHP_SELF?>">
<?
if ($selectedfile && $selecteddate == $oldselecteddate) {
showimage($selecteddate."/".$selectedfile);
showdates();
showfiles($selecteddate);
} elseif ($selecteddate) {
showdates();
showfiles($selecteddate);
} else {
showdates();
}
?>
</FORM>
<?
include('footer.inc');
?>
any help would be greatly appreciated.