Hi all.I found this code on a forum to confirm that the user wants to delete the record from database and that the link has not pressed accidently.But it is not deleting the record even after pressing ok.This is may be because the id is not passed properly. Can anyone tell why?Do I need to modify the javascript function?Here is my code:
function confirmation() {
var answer = confirm("Delete Record?")
if (!answer){
window.location = "by_hand.php";
}
else
{
window.location = "delete.php?delete=$id&action=deleteemployee";
}
}
<a href=# onclick='confirmation()'><img src='images/delete.png' alt='Delete' title='Delete' class='pngfix'></a>