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


    if (isset($_POST['DisplayImage']) && isset($_POST['Name']) && isset($_POST['ClientID'])){


      $DisplayImage = $_POST['DisplayImage'];
	  $Name = $_POST['Name'];
	  $ClientID = $_POST['ClientID'];

      $folder = "ClientImages";
      $decodedImage = base64_decode($DisplayImage);
      $return = file_put_contents($folder."/".$ClientID."/SliderImages/".$Name, $decodedImage);

      // success
      $response["success"] = 1;
      $response["message"] = $return;
      // echoing JSON response
      echo json_encode($response);
    }else{
		// success
      $response["success"] = 0;
      $response["message"] = "IMAGE NOT SEND";
      // echoing JSON response
      echo json_encode($response);
	}
?>
