<?php

$delIMG = $_POST["imgDEL"];
$path = $_POST['userFolder'];

function deleteFirstIMG2() {
    global $delIMG;
    global $path;
    $fileDelPath = $path.$delIMG;
   // echo $fileDelPath;
        if(file_exists($fileDelPath)){
            unlink($fileDelPath);
        }
  //  return $fileDelPath;
}

deleteFirstIMG2();

//echo "The image to delete is ".$delIMG;

//echo var_dump($_POST["key"]);

?>