PHP script to write a list of folder names inside a directory into .html file -
i create php script reads folders located in specific directory , writes names in .html file, structure of html should be:
<ul class="galleries"> <li><a href=".../control/includes/gallery-select.php?g=folder-xx">gallery 1</a></li> <li><a href=".../control/includes/gallery-select.php?g=folder-xx">gallery 2</a></li> </ul>
where folder-xx names of folders in control\data\img\gallery\
i'm not big expert of php i'll grateful hint.. , sorry english.
thanks
try this
echo "<ul>"; $folder_name = "."; $d = opendir($folder_name); while ($f = readdir($d)) { if (is_dir($folder_name."/".$f)) echo "<li><a href='your_script.php?dir=$f'>$f</a></li>"; } closedir($d); echo "</ul>";
Comments
Post a Comment