<?php
// array for JSON response
  $response= array();

     if (isset($_POST['Path']) && isset($_POST['File'])){

        $Path = $_POST['Path'];
        $Name = $_POST['File'];
        
        if (file_exists($Path.$Name)) {
            $file_to_delete = $Path.$Name;
            unlink($file_to_delete);
            $return = "File Deleted";
        }else{
            $return = "File Not Found";
        }
        
        // success
        $response["success"] = 1;
        $response["message"] = $return;
        // echoing JSON response
        echo json_encode($response);
    }else{
		// success
      $response["success"] = 0;
      $response["message"] = "No File Found";
      // echoing JSON response
      echo json_encode($response);
	}
?>