prepare("INSERT INTO subjects (name, teacher, room) VALUES (?, ?, ?)"); $stmt->bind_param("sss", $name, $teacher, $room); $stmt->execute(); $stmt->close(); } header("Location: subjects.php"); exit; } // FIX: Aggiunto redirect dopo update if(isset($_POST['update'])){ $id = intval($_POST['id']); $name = $_POST['name']; $teacher = $_POST['teacher']; $room = $_POST['room']; $stmt = $conn->prepare("UPDATE subjects SET name=?, teacher=?, room=? WHERE id=?"); $stmt->bind_param("sssi", $name, $teacher, $room, $id); $stmt->execute(); $stmt->close(); header("Location: subjects.php"); exit; } // FIX: Usa prepared statement anche per delete if (isset($_GET['delete'])) { $id = intval($_GET['delete']); $stmt = $conn->prepare("DELETE FROM subjects WHERE id=?"); $stmt->bind_param("i", $id); $stmt->execute(); $stmt->close(); header("Location: subjects.php"); exit; } ?>
| ID | Materia | Docente | Laboratorio | Azione |
|---|---|---|---|---|
| {$row['id']} | " . htmlspecialchars($row['name']) . " | " . htmlspecialchars($row['teacher']) . " | " . htmlspecialchars($row['room']) . " | Modifica | Elimina |
Nota: Questa pagina si vede meglio da computer desktop. Se sei da computer, puoi ignorare questo messaggio.
Copyright (C) 2025 EmmeV. - Released under GNU AGPL 3.0 License.