[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
PHPDirectoryIndex
Description:

function that reads directory content and returns the result as links to every file in the directory. toss it into any directory as index.php and get a list of links to every file

Code:

<? function directory($result) { $handle=opendir("."); while ($file = readdir($handle)) { if ($file == "." || $file == "..") { } else { print "<a href=$file>$file</a><br>\n"; } } closedir($handle);

return $result; }

?> <b>Select the file you want to go to:</b> <p> <? echo directory($result); ?>





last edited (May 18, 2007) by free_directory, Number of views: 649, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.