Re: code quest
| From: | Kirk Bailey | Date: | Thu, 02 Dec 2010 04:13:42 +0000 |
| Subject: | Re: code quest | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309810@lists.php.net to get a copy of this message | ||
OK, the quest thus far:
<html>
<head>
<TITLE>php experimental page</TITLE>
<style TYPE="text/css">
body { margin-left: 5%; margin-right: 5%; }
A:link, A:visited, A:active { text-decoration:none; }
A:hover { text-decoration:underline; }
</style>
</head>
<BODY text="000000" bgcolor="FFFFFF">
<h2 align="center">Subdirectory listing experimental menuing page</h1><P>
<ul>
<?php
$ls = scandir(dirname(__FILE__));
foreach ($ls as $d) {
if (is_dir($d) && $d != '.' && $d != '..') {
echo '<li><a href="'.$d.'">'.$d.'</a><br/>'.PHP_EOL;} } ?> </ul> <P> </body> </html> The results may be seen on this page: http://www.howlermonkey.net/dirlisting.php Can this be improved to exclude anything with a '.' or a '-' in it's name? This will exclude the smileys and cgi-bin and such. If it can be persuaded to read a 1 line description from each subdirectory it could then use THAT as the text in the link, instead of the name. This could be useful in many settings. Daniel P. Brown wrote:
On Fri, Nov 26, 2010 at 19:03, Kirk Bailey <kbailey@howlermonkey.net> wrote:Very Truly yours,I need a routine that will return a list of every directory immediately under the current directory- but nothing else, just a list of directories, 1 lev
- Kirk Bailey,
Largo Florida
kniht +-----+ | BOX | +-----+ think