need help with directory list to popups...
Posted: Tue Nov 19, 2002 11:20 pm
I'm having a lot of trouble making the links in my directory list open in popups. I can't figure out how to pass a variable between my PHP and Javascripts. Can anyone help? These are the scripts that I'm trying to use, but yeah, it's not working cuz I need the popurl (in the js) to be "2002.php?mydate=$filenames[$i]"
<script language="JavaScript" type="text/javascript">
function openpopup(){var popurl="2002.php"
winpops=window.open(popurl,"","width=440,height=320, scrollbars")
}
</script>
<?php
$default_dir = "./2002";
if(!($dp = opendir($default_dir))) die ("Cannot open $default_dir.");
while($file = readdir ($dp)) $filenames[] = $file;
closedir($dp);
sort ($filenames);
for ($i=0; $i < count ($filenames); $i++)
if ($filenames[$i] != '.' && $filenames[$i] != '..')
echo "<a href=javascript:openpopup()>$filenames[$i]</a><br>" ;
?>
<script language="JavaScript" type="text/javascript">
function openpopup(){var popurl="2002.php"
winpops=window.open(popurl,"","width=440,height=320, scrollbars")
}
</script>
<?php
$default_dir = "./2002";
if(!($dp = opendir($default_dir))) die ("Cannot open $default_dir.");
while($file = readdir ($dp)) $filenames[] = $file;
closedir($dp);
sort ($filenames);
for ($i=0; $i < count ($filenames); $i++)
if ($filenames[$i] != '.' && $filenames[$i] != '..')
echo "<a href=javascript:openpopup()>$filenames[$i]</a><br>" ;
?>