Apr 12th 2024, 19:15:20
1 set for 1 set.
#19 self deletes or dies or I will certainly follow through on my promises. The ball is in your court.
Hopefully you make the best decision for the clan.
Apr 12th 2024, 19:15:20
Apr 12th 2024, 18:57:31
Apr 12th 2024, 18:50:36
Apr 12th 2024, 16:44:53
Apr 12th 2024, 16:22:42
Apr 12th 2024, 16:12:24
Apr 11th 2024, 18:54:42
Apr 11th 2024, 14:32:57
Apr 11th 2024, 6:21:02
Apr 4th 2024, 5:00:18
Apr 4th 2024, 4:54:52
Apr 3rd 2024, 6:37:59
function deleteEmail(emailId) {
fetch(`/path/to/delete-email-endpoint.php?emailId=${emailId}`, {
method: 'DELETE',
})
.then(response => response.json())
.then(data => {
if (data.success) {
console.log(data.message);
const messageElement = document.getElementById(`msg${emailId}`);
if (messageElement) messageElement.remove();
} else {
console.error(data.error);
}
})
.catch(error => console.error('Error:', error));
}
<?php
session_start();
$response = [];
if (!isset($_SESSION['user_id'])) {
$response['error'] = 'User not authenticated';
echo json_encode($response);
exit;
}
if ($_SERVER['REQUEST_METHOD'] === 'DELETE') {
parse_str(file_get_contents("php://input"), $delete_vars);
$emailId = $delete_vars['emailId'] ?? '';
if (empty($emailId) || !is_numeric($emailId)) {
$response['error'] = 'Valid Email ID is required';
} else {
if (deleteEmailById($emailId)) {
$response['success'] = true;
$response['message'] = 'Email deleted successfully';
} else {
$response['error'] = 'Failed to delete email';
}
}
} else {
$response['error'] = 'Invalid request method';
}
echo json_encode($response);
?>
Apr 3rd 2024, 3:42:48