In index.php:
<script>
function doDel(id){
if(confirm("Confirm deletion?")){
window.location="action.php?action=del&id" id;
}
}
</script>
and
<a href='javascript:void(0);' onclick='doDel({$row['id']})'>Delete</a>
In action.php:
case 'del':
$id = $_GET['id'];
$sql = "delete from stu where id='$id'";
$rw = mysqli_query($conn,$sql); ;script>alert('Deletion successful');</script>";
}else{
with with script>";
script >
Isn’t the id passed over? &id="+id