-1
Javascript
$('#save-update').data('eventId', info.event.id);
$('#delete-update').click(function (info) {
info.preventDefault();
let eventID = $('#save-update').data('eventId');
$.ajax({
type: 'POST',
url: 'php/delete-events.php',
data: eventID,
contentType: false,
processData: false,
success: function(response) {
location.reload();
}
})
});
PHP
$id = $_POST['eventID'];
The id value for the PHP file is not coming. Notice: Undefined index: eventID
It’s still the same, PHP can’t get the value. He is making the request and even gave an Alert in eventID in JS and leaving the id value, but not going to PHP.
– Gabriel Souza
removes the line from "processData" and "contenttype"
– Guilherme Henriques
Yeah, it worked. Thank you very much!
– Gabriel Souza
happy to help you
– Guilherme Henriques