Posted by patrick_woflian on 09/27/06 11:34
cheers for all your help.. the code works now.. but it only loads two
images despite there being more in the directory.. any ideas why this
is? im looking to post about 7 pictures... heres the new code:
<html>
<head>
<title>
My wonderfully great pictures
</title>
</head>
<body>
<BODY BGCOLOR = "green">
<pre>
<h1> Photo Gallery </h1>
Click on the link to view image in separate window
</pre>
<?php
$handle = opendir('pictures');
if($handle) {
while(false !== ($file = readdir($handle))) {
if(preg_match("/\w+(.jpg)/",$file)) {
print"<a href='pictures/$file'>$file</a>";
print "$file <br>";
}
}
closedir($handle);
}
?>
</body>
</html>
[Back to original message]
|