File Name: index.php
Here’s how it works:
1. When you run this code, you will see a delete link.
3. If you click on “Cancel”, nothing will happen aside from the box will disappear.
4. If you click on “OK”, the page will be redirected to itself together with the parameters “action” and “id”, it is on this part window.location = ‘index.php?action=delete&id=’ + id;
5. It will then evaluate our PHP script to delete the record from the database.