$product = new Product(); if (isset($_SESSION['name']) and $_SESSION['id'] == '10207674962976867') { if (isset($_GET['id_product'])) { $id_product = $_GET['id_product']; //echo "<script type=\"text/javascript\"> // alert('Se ha borrado correctamente el producto'); //history.go(-2); //</script>"; //exit; $query = $pdo->prepare('DELETE FROM Productos WHERE id_product = ?'); $query->bindValue(1, $id_product); $query->execute(); echo "<script type=\"text/javascript\">\n alert('Se ha borrado correctamente el producto');\n history.go(-2);\n </script>"; exit; } $products = $product->fetch_all(); ?> <html> <head> <title>Eliminar Producto - Version editable</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head> <body> <div class="container"> <!--<a href="index.php" id="logo">CMS</a>--> <br/> <h4>Selecciona un producto para borrar</h4>