1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| <html>
<head>
<title>Images</title>
<style type="text/css" title="text/css" media="all">
.error {
fon-weight: bold;
color: #C00
}
</style>
<script language="JavaScript">
<!-- // Hide from old browsers.
function create_window(image, width, height){
width=width+10;
height=height+10;
if (window.popup && ! window.popup.closed){
window.popup.resizeTo(width, height);
}
var specs="location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes, left=0, top=0, width=" + width + ", height=" + height;
var url="show_images.php?image=" + image;
popup=window.open(url, "ImageWindow", specs);
popup.focus();
}
//--></script>
</head>
<body>
<p> click on an image to view it in a separate window.</p>
<table align="center" cellspacing="5" cellpadding="5" border="1">
<tr>
<td align="center"><b>Image name</b></td>
<td align="center"><b>Image Size</b></td>
</tr>
<?php
$dir='../../uploads';
$files=scandir($dir);
foreach ($files as $image){
if ((substr($image, 0, 1)!='.') && ($image!='Thumbs.db')){
$image_size= getimagesize ("$dir/&image");
$file_size=round((filesize("$dir/&image"))/1024) . "kb";
$image=urlencode($image);
echo "\t<tr>
\t\t<td><a href=\"javascript:create_window('$image',$image_size[0],$image_size[1])\">$image</a></td>
\t\t<td>$file_size</td>
\t</tr>\n";
}
}
?>
</table>
</body>
</html> |
Partager