October 2009
Beginner
408 pages
7h 27m
English
You've almost completed your administrative controls. All that's left is to add the ability to delete entries. This is fairly straightforward, due to the way that you've constructed the delete link.
The link passes delete as $_GET['page'], so it's easy to identify entries marked for deletion. In admin.php, you check whether $_GET['page'] == 'delete', then pass the entry URL to be deleted to a function called confirmDelete()—you'll write this function in the next section. This function asks the user to confirm that she does in fact wish to delete the entry.
Do this by adding the following code in bold to admin.php:
<?php /* * Include the necessary files */ include_once 'inc/functions.inc.php'; include_once 'inc/db.inc.php'; ...
Read now
Unlock full access