basic-php-appendix-ch07ex01.php / php
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF"> <?php if (isset(//get the folder to search for folder_to_find = //set the default directory default_dir = array(realpath("/Inetpub/wwwroot/beginning_php5/appendix_a/")); //create an array to hold any matches default_dir) > 0) { foreach (dir_key => dir = @opendir(file = readdir(file != '.') && (real_path_name = realpath(file); if (is_dir(real_path_name, real_path_name, default_dir[] = folder_to_find == dir_list[] = dir); } startingdir; unset(dir_key]); } } dir_list); sort(dir_list as dirname."<br>"; } } ?> <form method="POST" action=<ch07ex01.php>> <input type="hidden" name="posted" value="true"> <table width="100%" border="0" cellpadding="6"> <tr> <td><b><font face="Arial, Helvetica, sans-serif">Welcome to Beginning PHP5</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Chapter 07</font></b></td> <td><b><font face="Arial, Helvetica, sans-serif">Exercise 01</font></b></td> </tr> <tr> <td colspan="3"> <p><font face="Arial, Helvetica, sans-serif" size="-1">Please enter the folder to search for:</font></p> <table width="40%" border="0" cellpadding="6" align="center"> <tr> <td width="36%"><font face="Arial, Helvetica, sans-serif" size="-1"><b>Folder Name</b></font></td> </tr> <tr> <td width="36%"> <input type="text" name="folder_name" size="40"> </td> </tr> <tr> <td width="36%"> <input type="submit" name="search" value="Search"> </td> </tr> </table> <p> </p> </td> </tr> </table> </form> </body> </html>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.