ppeasy/public/searchengine/togglehide.php

26 lines
644 B
PHP

<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
include "../db.php";
if (isset($_POST['ididentificationparts']) && isset($_POST['hide'])) {
$ididentificationparts = $_POST['ididentificationparts'];
$newHide = $_POST['hide'];
$stmt = $conn->prepare("UPDATE identificationparts SET hide = ? WHERE ididentificationparts = ?");
$stmt->bind_param("si", $newHide, $ididentificationparts);
if ($stmt->execute()) {
echo "Stato aggiornato con successo";
} else {
echo "Errore: " . $stmt->error;
}
$stmt->close();
$conn->close();
} else {
echo "Parametri mancanti";
}