note 20782 rejected from class.dir by victor

From: Date: Sat, 24 Aug 2002 12:47:36 +0000
Subject: note 20782 rejected from class.dir by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-35452@lists.php.net to get a copy of this message
If the above function hits a recycle bin function it will throw some pretty funny errors I used it like this in a windows based server . . the only problem is running it on a ROOT windows directory it looks cool in a Java pop up window <html><head><title>Directory Listing</title></head> <body bgcolor="#000000" text="#CCCCCC" link="#CCCCCC" vlink="#CCCCCC" alink="#CCCCCC"> <table width="60%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#006666"> <tr> <td> <div align="center"><font face="Arial, Helvetica, sans-serif" size="2"><b>Directory Listing</b></font></div> </td> </tr> </table> <?php function getDirList ($dirName) { $d = dir($dirName); $dirName = strtoupper($dirName); while($entry = $d->read()) { if ($entry != "." && $entry != "..") { if (is_dir($dirName."/".$entry." ")) { getDirList($dirName."/".$entry); } else { ?> <table width="60%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#003366"> <tr> <td> <div align="left"><font color="#009999"> <a href="<?php echo $dirName."/".$entry; ?>" target="_blank"> <font size="1" face="Arial, Helvetica, sans-serif"> <b><?php echo $dirName; ?> </b></font> <font size="1" face="Arial, Helvetica, sans-serif"><b><?php echo $entry; ?></b></font></a></font></div> </td> </tr> </table> <?php } } } $d->close(); } getDirList("."); ?> </body></html>

« previous php.notes (#35452) next »