You are here: Re: list files from directory on a site « HTML « IT news, forums, messages
Re: list files from directory on a site

Posted by Martin Jay on 05/05/06 04:43

In message <pcGdnTWHwJNZA8fZnZ2dnUVZ_vSdnZ2d@giganews.com>, Jim Moe
<jmm-list.AXSPAMGN@sohnen-moe.com> writes
>chlori wrote:
>>> If you can run PHP files on your server you could use something like
>>> this:
>>>
>>> <?php
>>> $dir=""; // Directory where files are stored
>>> if ($dir_list = opendir($dir)) {
>>> while(($filename = readdir($dir_list)) !== false) {
>>>
> That should be "readdir($dir_list)) != false".

It's better to use !== in case there is a file named '0' (as I wasted
quite some time and effort discovering a while ago). :(
--
Martin Jay

 

Navigation:

[Reply to this 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

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