<?php session_start(); /** * Deletes a DVD from the database. The user has already passed a confirmation page. */ require_once "dvd-db.php"; require_once "dvd-util.php"; ensure_authenticated(); if (array_key_exists('delete_dvd', $_SESSION)) { $dvd = $_SESSION['delete_dvd']; $title = $dvd[0]; delete_dvd($title); add_message("DVD ({$title}) successfully deleted."); } else { add_error("Error - no DVD selected to delete!\n"); } unset($_SESSION['delete_dvd']); header("Location: index.php");
public function tearDown() { delete_dvd($this->the_title); delete_genre($this->genre); delete_user($this->testusername); }