<?php

echo "<title>Hupto - IMG List</title>";

if($_GET['sil']){
$file = $_GET['sil']; 
        // Delete the given file
        unlink("upimg/".$file); 

echo "SİLİNDİ";

}else{


define('IMAGEPATH', 'upimg/');

/*print_r(glob(IMAGEPATH.'*'));*/
	


$myarray = glob(IMAGEPATH.'*');
usort($myarray, create_function('$a,$b', 'return filemtime($a) - filemtime($b);'));

$listem = array_reverse($myarray);

foreach($listem as $veri){
    $imag[] =  basename($veri);
}

foreach ($imag as $veri) {
	

$cikti = "https://hupto.cntapi.com/assets/upimg/".$veri;


echo "<center><img style='max-width: 150px' src='".$cikti."'><br /><a target='_blank' href='imglist.php?sil=".$veri."'>SİL</a><br /><b>#################################</center></b><br /><br /><br />";

}
}



?>