im trying to post image that been convert to url by using ajax. The problem is $image = $_POST['imgData'];
not show anything but if i check developer tools on network preview the data can be seen.
this is my script
var canvas = document.getElementById('chart1');
var imgData = canvas.toDataURL('image/png', 1);
//console.log(imgData);
$.ajax({
type: "POST",
url: "?f=view_customer_list",
data: { imgData: imgData },
success: function(response) {
alert(imgData);
}
});
php code
$image = $_POST['imgData'];
echo $image;
i want the url can be echo in my page
New contributor
Unknown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.