I was writing a script that was supposed to read images from the directory and get the imagesizes and use them as arguments in the displayImage javascript. However the error that i get is that the images can't be opened for reading. I changed the directory permissions for all to have read and write and still it doesn't work.
Any thoughts.
addy: http://kwylez.digitalcaffeine.com/gallery/temp.php
//code starts now
<? require("$DOCUMENT_ROOT/common/common.inc"); ?>
<?php html_header("Gallery"); ?>
<body topmargin="0" marginheight="0" >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" width="100%">
<table border="0" cellpadding="1" cellspacing="0" width="770">
<tr>
<td bgcolor="black">
<?php commonHeader(); ?>
<!--content--->
<table border="0" cellpadding="0" cellspacing="0" width="770" bgcolor="#ffffff" height="560">
<tr><td align="left" valign="top" width="150" class="headings">
<font face="verdana" size="-1" color="#b4b4b4">
[+]</font>Random<font face="verdana" size="-1" color="#b4b4b4">[+]</font>
<br><br><?php commonLinks(); ?><br>
</td>
<td align="left" valign="top" width="400" style="border-right:1px dotted black;">
<!--content-->
<table border="0"cellpadding="5"cellspacing="0" width="400" >
<tr>
<td align="center" width="400">
<font face="verdana" size="-1" color="#b4b4b4">[+]</font><font face="verdana" size="-1" color="#800000">Gallery</font><font face="verdana" size="-1" color="#b4b4b4">[+]</font>
</td>
</tr>
<tr>
<td align="left" width="400">
<?php
$image_dir = "/home/cwiles/web/gallery/images/thumbnails";
$handle = opendir($image_dir) or die("Couldn't open the dir ".$image_dir);
while(!false==($files = readdir($handle)))
{
if($files != "." && $files != "..")
{
$size = getimagesize($files);
echo "<a href=\"javascript:displayImage('images/".$files."',".$size[0].", ".$size[1].");\"><img src=\"images/thumbnails/".$files."\" border=\"0\"></a> \n";
}
}
?>
</td>
</tr>
</table>
<!--end of content-->
<?php commonFooter(); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>