You are here: Re: Folder list with Pagination « PHP Programming Language « IT news, forums, messages
Re: Folder list with Pagination

Posted by Noodle on 09/11/06 12:30

jerryyang_la1@yahoo.com wrote:
> I'm looing for a simple PHP file list program, that will show all the
> files in a folder, but show them in batchs of 10 - 15..
>
> Any ideas??
>
> Many Thanks

This is a little crude but it should get the job done.

<?php
if ($handle = opendir('.')) {
$count = 0;
while (false !== ($file = readdir($handle))) {
echo $count == 0 ? "<ol>" : "";
echo "<li>$file</li>";
$count++;
if($count == 10){
echo "</ol>";
$count = 0;
}
}
echo $count != 10 ? "</ol>" : "";
closedir($handle);
} ?>

 

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

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