I have a script that lists the files, but it seems to order then randomly...I need them to be in order.
Here is the script:
Code: Select all
<?php
function list_files($dir)
{
if(is_dir($dir))
{
if($handle = opendir($dir))
{
while(($file = readdir($handle)) !== false)
{
if($file != "." && $file != ".." && $file != "Thumbs.db"/*pesky windows, images..*/)
{
echo '<a href="gallery1_page.php?page='.$file.'.php" target="_blank">'.$file.'</a>, '."\n";
}
}
closedir($handle);
}
}
}
?>
<font size="3">
<?
list_files("pages/");
?>Any ideas on the ordering?