<?php include 'util/DBController.php'; $db = new DBController(); if (isset($_POST['eventname']) && isset($_POST['date'])) { if (isset($_POST['description'])) { $description = $_POST['description']; } else { $description = ""; } if (isset($_POST['location'])) { $location = $_POST['location']; } else { $location = ""; } $album_ID = $db->insert_album($_POST['eventname'], $description, $location, $_POST['date']); header('Location: album.php?id=' . $album_ID); die; }