Hi Guys,
So i am using the signature widget and storing the image using the below code:
<?php
$data_uri = $this->data('signature');
$encoded_image = explode(",", $data_uri)[1];
$decoded_image = base64_decode($encoded_image);
file_put_contents("signature.png", $decoded_image)
?>
What I want to do is store the signature image with a unique name based on a data variable from the field i.e. {data:name}
How can I edit the above file_put_contents("signature.png", $decoded_image) to replace signature.png with a variable name?
So i am using the signature widget and storing the image using the below code:
<?php
$data_uri = $this->data('signature');
$encoded_image = explode(",", $data_uri)[1];
$decoded_image = base64_decode($encoded_image);
file_put_contents("signature.png", $decoded_image)
?>
What I want to do is store the signature image with a unique name based on a data variable from the field i.e. {data:name}
How can I edit the above file_put_contents("signature.png", $decoded_image) to replace signature.png with a variable name?