note 40521 deleted from function.highlight-file by aidan

From: Date: Sun, 26 Sep 2004 13:56:18 +0000
Subject: note 40521 deleted from function.highlight-file by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77373@lists.php.net to get a copy of this message
Note Submitter: zoulotion at hotmail dot com ---- List files and highligt them <? if (is_dir($_GET['file'])) chdir($_GET['file']); else { $a=explode("/",$_GET['file']); for($i=0;$i<count($a)-1;$i++){ $cd.=$a[$i]."/"; } chdir($cd); } echo("<html><body bgcolor=\"#000000\">"); $dir=getcwd(); if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { $list[]=$file; } closedir($dh); } } asort($list); if (!is_null($_GET['file'])&&!is_dir($_GET['file'])) { echo("<font color=white>".$_GET['file']."</font>"); echo("<table border=1 bordercolor=\"#777777\" cellspacing=0"); echo("cellpadding=0 bgcolor=\"#ffffff\" width=\"100%\"><tr><td>"); highlight_file($_GET['file']); echo("</td></tr></table>"); } while (list($key, $val) = each($list)) { if (is_dir($val)) $col="<font color=\"#ffffff\">"; else $col="<font color=\"#aaaaff\">"; if ($_GET['file']==(getcwd()."/".$val)) $col="<font color=\"#00ff00\">"; echo("<a href=highlight.php?file=".getcwd()."/".$val.">"); echo($col.$val."</font></a><br>"); } echo("</html>"); ?> Hope you like it ;)

« previous php.notes (#77373) next »