// The subdirectory that stores cam shots
$short = "/camshots";
// The full system path of the cam shot subdirectory
$long = "/[URL unfurl="true"]www/joeuser/htdocs/camshots";[/URL]
function showdirectory($short,$long) {
print ("This lists images in a directory:<br>");
if (is_dir($long))
{
if ($dh = opendir($long))
{
while (($filename = readdir($dh)) !== false)
{
if (($filename != ".") && ($filename != ".."))
{
$files[]="$filename";
}
}
closedir($dh);
}
}
natcasesort($files);
foreach ($files as $myfilename) {
print ("<a href=\"$short/$myfilename\">$myfilename</a><br>");
}
}