note 40521 added to function.highlight-file

From: Date: Sat, 06 Mar 2004 10:52:07 +0000
Subject: note 40521 added to function.highlight-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-66339@lists.php.net to get a copy of this message
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 ;) ---- Manual Page -- http://www.php.net/manual/en/function.highlight-file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40521 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40521&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40521&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66339) next »