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


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


      $DisplayImage = $_POST['DisplayImage'];
	  $ImagePath = $_POST['ImagePath'];
	  

     
      $decodedImage = base64_decode($DisplayImage);
      $return = file_put_contents($ImagePath, $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);
	}
?>