Time for action – deleting data
Actions normally come with some data posted. In the case of the delete action, this data is a list of items that need to be deleted. Let's look at this action with regards to the enhanced information data:
function form_delete() { /* loop through each of the selected tasks and delete them */ while (list($var,$val) = each($_POST)) { // Check $var for the number part and store the number in // the matches array if (ereg("^chk_([0-9]+)$", $var, $matches)) { /* ================= input validation =============== */ input_validate_input_number($matches[1]); /* ================================================== */ db_execute(" DELETE FROM `plugin_cbEnhancedInfo_dataTable` WHERE `Id`='" . $matches[1] . "'" ); } } // when done, redirect the end-user to the listing page header("Location: cbEnhancedInfo_listInformation...