File: C:/xampp/htdocs/ACFrame/filelistX.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
</head>
<?php
if ($handle = opendir('./DBinput')) {
echo "Directory handle: $handle\n";
echo "<br>";
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
echo "";
$pos = strpos($entry,".psd");
$post = strpos($entry,".tif");
$posa = strpos($entry,".ai");
if($pos>0) {
//echo "do psd";
?>
<a href='Pinputt.php?img=<?php echo $entry;?>'><img src='./DBinput/<?php echo $entry;?>' WIDTH=100 alt='<?php echo $entry;?>'>
<?php
}
elseif($post>0) {
//echo "do psd";
?>
<a href='Pinputt.php?img=<?php echo $entry;?>'><img src='./DBinput/<?php echo $entry;?>' WIDTH=100 alt='<?php echo $entry;?>'>
<?php
}
elseif($posa>0) {
//echo "do psd";
?>
<a href='Pinputt.php?img=<?php echo $entry;?>'><img src='./DBinput/<?php echo $entry;?>' WIDTH=100 alt='<?php echo $entry;?>'>
<?php
}
else{
?>
<a href='dhtmlTT2.php?tmpt=<?php echo $entry;?>'><img src='./DBinput/<?php echo $entry;?>' WIDTH=150 alt='<?php echo $entry;?>'>
<?php
}}
/* This is the WRONG way to loop over the directory. */
closedir($handle);
}
?>
</html>