Hello again. I rewrote the script and got it to work like I wanted.
Sorry for all the missing " tags.
However there is one more thing I would like to get the script to do, and it's not excactly a php thing.
I would like that the dropdown menu will show the active/current page Im on.
Now it resets to page 2 after I select a page.
Any idea how I do this ?
Here is the working script :
<?php
$pageNo = $_GET['pageNo'];
$filesPerPage = "28";
$dir = "../media/audio/*.wav";
$readDir = glob($dir);
$sliceDir = array_slice($readDir,$pageNo,$filesPerPage);
echo "<table border=1><tr><td bgcolor=gray colspan=5><font color=white>Phonetic Database<font></td></tr>";
echo "<tr><td bgcolor=lightgrey>Name</td><td bgcolor=lightgrey><!--Player--></td><td bgcolor=lightgrey>Size</td><td bgcolor=lightgrey>Date</td>";
echo "<td>Page ".$pageNo." ";
echo "<select onchange='window.location.href=this.options[this.selectedIndex].value;'";
for($i=1; $i<=count($readDir); $i++) {
echo "<option value=index.php?pageNo=$i>".$i."</option>";
}
echo "</select></td>";
echo "</tr>";
foreach ($sliceDir as $file) {
echo "<tr>";
echo "<td>".substr($file,26)."</td>";
echo "<td><object>
<param name=autostart value=false>
<param name=src value=$file>
<param name=autoplay value=false>
<param name=controller value=true>
<embed src=$file controller=true autoplay=false autostart=false type=audio/wav height=15>
</object>
</td>";
echo "<td>".round(filesize($file)/(1024)/(1024),1)." MB</td>";
echo "<td>". date("d.m.Y H:i:s", filemtime($file))."</td>";
echo "<td></td>";
echo "</tr>";
}
echo "</table>";
echo count($readDir)." files";
?>