PX : code

Download this code


<?php
/* function type: navbar()
   Writer: Harley S. Bull
   Version: 0.4
   Writer Homepage: www.neta.com/~harly

   Purpose:
             To provide a dymanic code in PHP for displaying all the htm

type files
             in a givin directory.

   Use:
             For any site that sits in one directory(Non domain sites)

   Next:

             Graphical representation of the links.
             Cmap for header.

*/
function navbar()
{
$files dir(".");
$pipe  " | ";
//performs until no files left in directory
while ($current $files->read())
  
//ignor all files not of htm type.
   
if (strpos($current"htm")!= FALSE)
       
//ignors the current page(i.e. index.phtml)
      
{   if (strpos($current"ndex") == FALSE)
          {
          print 
"<a href='";
          print 
$current;
          print 
"'>";
          print 
$current;
          print 
"</a>";
          print 
$pipe;
          }; 
      };

?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.