MrTickles
02-15-2003, 01:05 PM
Hello,
I have this code to make a simple photogallery:
<?
echo "<HTML><BODY Bgcolor=black><CENTER>";
chdir('.');
$handle=opendir('.');
readdir($handle);
readdir($handle);
echo "<BR>";
while (($file = readdir($handle))!==false){
$size=(filesize($file)/100);
echo "<TABLE BORDER=1 BORDERCOLOR=BLUE><TR bgcolor=dddddd><TD><A HREF=$file><img src=$file width=200 height=160></A></TD><TD width=200 height=75>Name: $file <BR> Size: $size Kb</TR></TABLE>";
}
echo "<BR>";
?>
I would like to know how to make so it only reads .jpg, .gif, .png, and .bmp files.
Currently it tries to make a thumbnail of every file in the directory
:(
Any help would be awesome Thanks!
I have this code to make a simple photogallery:
<?
echo "<HTML><BODY Bgcolor=black><CENTER>";
chdir('.');
$handle=opendir('.');
readdir($handle);
readdir($handle);
echo "<BR>";
while (($file = readdir($handle))!==false){
$size=(filesize($file)/100);
echo "<TABLE BORDER=1 BORDERCOLOR=BLUE><TR bgcolor=dddddd><TD><A HREF=$file><img src=$file width=200 height=160></A></TD><TD width=200 height=75>Name: $file <BR> Size: $size Kb</TR></TABLE>";
}
echo "<BR>";
?>
I would like to know how to make so it only reads .jpg, .gif, .png, and .bmp files.
Currently it tries to make a thumbnail of every file in the directory
:(
Any help would be awesome Thanks!