Codice PHP:
<?php
////////////////////
session_start();
//////////////////
$username = "user";
$password = "pass";
if($username==$_POST['username'] AND $password==$_POST['password']){
////////////////////
$_SESSION['auth']= true;
///////////////
$dir = "Gum_files/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
echo "<ul>";
while (($file = readdir($dh)) !== false) {
if($file == "." || $file == ".."){continue;}
echo "[*]File: ".$file." - <a href=\"admin.php?delete=".$file."\" >Cancella</a>";
}
echo "[/list]";
closedir($dh);
}
}
if($_GET['delete']!=""){
$nomefile = $dir.$_GET['delete'];
unlink($nomefile);
}
}else{
header(Refresh:0, URL:"login.php");
}?>