Thank you for the answer
I tried the code but I just want it to list the directory
I tried something I tried to create it like the picture below
I used form submit post in folder names menu
to send the clicked directory name to the right
Only the option to delete pictures from buttons works
i work for others to work
Directory listing code
$pathLen = 0;
function prePad($level)
{
$ss = "";
for ($ii = 0; $ii < $level; $ii++)
{
if($ii == 0){
$ss = $ss . "|-";
}else{
$ss = $ss . "--";
}
}
return $ss;
}
function myScanDir($dir, $level, $rootLen)
{
global $pathLen;
if ($handle = opendir($dir)) {
$allFiles = array();
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
if (is_dir($dir . "/" . $entry))
{
$allFiles[] = "D: " . $dir . "/" . $entry;
}
else
{
$allFiles[] = "F: " . $dir . "/" . $entry;
}
}
}
closedir($handle);
natsort($allFiles);
foreach($allFiles as $value)
{
$displayName = substr($value, $rootLen + 4);
$fileName = substr($value, 3);
$linkName = str_replace(" ", "", substr($value, $pathLen + 4));
if (is_dir($fileName)) {
//echo '<img src="../images/folder.png" /> '.prePad($level) . $linkName . "<br>\n";
echo '<button type="submit" class="klasor-buton" name="klasor" value="'.$linkName.'/"><img src="../images/klasor.png" /> '.prePad($level) . $linkName . '</button>';
echo "<br>\n ";
myScanDir($fileName, $level + 1, strlen($fileName));
} else {
//echo prePad($level) . "<a href=\"" . $linkName . "\" style=\"text-decoration:none;\">" . $displayName . "</a><br>\n";
}
}
}
}
$pathLen = strlen($root);
myScanDir($root, 0, strlen($root));
The code for listing images in the directory
foreach(glob($images."/".$geri_dizin.'*.{jpg,JPG,jpeg,JPEG,png,PNG}',GLOB_BRACE) as $file){
echo '<div class="img">';
echo '<img class="image" src="'.$images."/".$geri_dizin.basename($file).'" title="Editöre eklemek için tıkla" onclick="returnFileUrl(\''.$editore_dizin.basename($file).'\')">';
echo "<br />\n";
echo '<input type="checkbox" id="secilen" name="secilen[]" value="'.basename($file).'" title="Silmek veya Taşımak için seçin"> <strong>Sil veya Taşı</strong><br />';
echo basename($file);
echo '</div>';
}
I would appreciate if you can help those with missing or faulty