<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv = 'refresh' content = '5000; url = SingleFileDelete.php'>

<style>
body{max-width:600px; margin:5px auto; font-family:arial; color:#999;}
.sdm{margin-top:-15px;}

.clgr {color:red;}
.clgr2 {color:blue;}
.clgr3 {color:limegreen;}
.clgr4 {color:#000099;}
.clgr5 {color:#ff6600;}
.clgr6 {color:#cc0099;}
.clgr7 {color:#00cc00;}

</style>


<!-- <a href='../SingleFileDelete.php?do=$image'> <center> Delete </center> </a> <br> -->

<?php
$delete = ''. $_GET['do'].'';
if(unlink("extraimages/$delete")){echo "<center> <h3 style='font-family:arial; color:red; font-size:25px;'> '$delete' <span style='color:limegreen;'> File is deleted succesfully </span> </h3> </center>
<br> <meta http-equiv = 'refresh' content = '2; url = SingleFileDelete.php?done'>";}
else {echo "<center> <h3 style='font-family:arial; font-size:25px; color:red;'>Select File and Delete </h3> </center><br>";}

echo "<div style='margin-top:-50px;'>";
$dir = "extraimages/";
$file= scandir($dir,1);
echo "<ol>";
foreach ($file as $value) {
  echo "<span style='color:black; font-family:arial; font-size:20px; line-height:18px;'> <li> <a href='extraimages/$value'> $value </a>
  &nbsp;- <a href='?do=$value' title='Delete File'><span style='color:white; font-family:arial; background:#ff0000;padding:0px 4px; border-radius:5px;'>X</a> </li> </span><br>";
}
echo "<ol>";
echo "</div>";


//$path="extraimages/09.jpg"; if(unlink($path)){echo "<h3> $path file is deleted </h3>";} else {echo "<h3> Select File for Delete </h3>";}
//$path="extraimages/10.jpg"; if(@unlink($path)) {echo "<h3 class='sdm'> $path file is deleted know </h3>";} else {echo "<h3 class='sdm'> Select image File for Delete </h3>";}

?>



<!DOCTYPE html>
<html>
<title>UPLOAD VIEW DELETE PAGE</title>
<meta name="viewport" content="width=device-width, initial-scale=1">  
  <link href="favicon.png" rel="icon">
  <link href="favicon.png" rel="apple-touch-icon">
<style>
body{font-family:arial;}
a:visited, a:link, a:active{color:blue; text-decoration:none;}
a:hover{color:limegreen;}
.sd{background:red; color:white; }
.sd:hover{background:limegreen; color:yellow; }
</style>

<body style="background: linear-gradient(to bottom right, #ffffff 50%, #e6ffff 70%, #ffccff 100%); 
background-repeat: no-repeat; background-attachment: fixed;">
    
    
<?php  
$target_dir = "extraimages/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) 
{
echo "<center><h2 style='color:#00cc00; font-family:arial;'><b> $target_file </b> <span style='color:blue;'> The file has been successfully upload.</span> </h2></center>";
header('refresh:3; URL= SingleFileDelete.php');
} 
else
{
echo "<center><h2 style='color:#000066; font-family:arial;'><b> Select File and Upload </b></h2></center>";
}
?>


<div style="background: linear-gradient(to top, #0066ff 0%, #ccffff 100%); 
padding:5px; max-width:355px; font-family:arial; margin:5px auto; border-radius:12px;">
<center>
<span style='color:#006600;'> You Have Upload Anytype file. </span>
<h2 style='margin:4px;color:#000;'><b> Select Any File to Upload: </b></h2>
</center>

<form action="" method="post" enctype="multipart/form-data">
<center><input type="file" name="fileToUpload" id="fileToUpload" style="font-size:20px; 
font-family:arial; background:white; padding:2px; max-width:330px; cursor:pointer; color:#000;"></center>
<center><input type="submit" value="Upload File" name="submit" style="margin-top:5px; 
font-size:18px; font-family:arial; background:white; padding:5px; cursor:pointer; border-radius:5px;"></center>
</form>
</div>

<center>Your Files Uploaded in images Folder</center>

</body>
</html>

