In the preceding example, a new version of the view_users.php script was written. This one now includes links to the edit_user.php and delete_user.php pages, passing each a user’s ID through the URL. This next example, delete_user.php, will take the passed user ID and allow the administrator to delete that user. Although you could have this page simply execute a DELETE query on the database, for security purposes (and to prevent an inadvertent deletion), there will be multiple steps:
The page must check that it received a numeric user ID.
A message will confirm that this user should be deleted.
The user ID will be stored in a hidden form input.
Upon submission of this form, the user will actually be deleted. ...