All pastes #147214 Raw Edit

Sh4d03

public text v1 · immutable
#147214 ·published 2006-08-24 06:18 UTC
rendered paste body
 $path = "/home/allstate/public_html/client"; // <-- Path to the location of files

                        function getList($path)

                        {

                                $dh=opendir($path);

                                while($file=readdir($dh))

                                {

                                        $currFile = "$path/$file";

                                        if (is_dir($currFile))    

                                        {

                                                if ($file !='.' && $file !='..')

                                                {
                                                
                                                        # its a dir, recurse.
                                                        getList($path.'/'.$file);
                                                        $dirArray[$i] =  "Client: $path/$file<br>\n";
                                                        $i++;
                                                }

                                                 else

                                                {       

                                                        # its a file.
                                                        $listArray[$j] = "-- $path/$file<br>\n";
                                                        $j++;

                                                }

                                        }

                                }

                        }