Hi all

I need to create a form which allows the user to create directories within a specific folder that I would specify (for example /public_html/mydocs/).

I have seen on certain ISP control panels, a list box that displays the current folder structure of a particular folder (or entire server for that matter) and I would like to know how to achieve this.

My idea would be to have the user type the name of the directory to be created into a text field and then select the folder it needs to be created within from this list box - if someone could help me out with the population/creation of the list box part I would greatly appreciate it.

Any code snippets of how to do this would be great.

Many Thanks

    Thanks but i have sorted it.

    Here is the solution to those who may also need something similar.

    															[code=php]<select id="location" name="location" size="1" class="selectfield">

    <?php
    echo " <option value=\"0\">(Please Select)</option>\n";

    $dir_handle  =  @opendir($path)  or  die("Unable to open $path");  
    while  (false !== ($file = readdir($dir_handle)))  {  
    	if ($file == ".." || is_file($file))
    	continue;
    	if ($file == ".") {
    		$file = "/";
    	}
    
    	echo "   <option value=\"$file\">$file</option>\n";
    }
    closedir($dir_handle);

    ?>
    </select> [/code]

      Write a Reply...