Reply to Re: showing images from a directory

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация