Código PHP:
<?php require_once('../lib/conexion.php');
$cn= Conectarse();
$id = (int) $_GET['id'];
$action = $_GET["action"];
if ($action == "del_comercio") {
mysql_query("DELETE FROM `comercios` WHERE `id` = '$id' ") ;
header("location: index.php?page=comercios");
}
if ($action == "del_rubro") {
mysql_query("DELETE FROM `rubros` WHERE `id_rubro` = '$id' ") ;
header("location: index.php?page=rubros");
}
if ($action == "del_usuario") {
mysql_query("DELETE FROM `usuarios` WHERE `id` = '$id' ") ;
header("location: index.php?page=usuarios");
}
?>