Location: PHPKode > projects > XMasDB > xmasdb/delete.php
// start the session

// is the one accessing this page logged in or not?
if (!isset($_SESSION['basic_is_logged_in']) 
    || $_SESSION['basic_is_logged_in'] !== true) {

    // not logged in, move to login page
    header('Location: index.php');

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<style type="text/css">@import url("style.css");</style>
<title>X-Mas Gift Database</title>

<h2>X-Mas Gift Database</h2><br>


include 'config.php';
include 'lib/opendb.php';

	$id = $_GET['id'];
    $sql = "DELETE FROM gifts WHERE id=$id";
    $result = mysql_query($sql);
    echo "<h3>Gift deleted!</h3><br><p align='center'><input type=\"button\" class=\"btn\" onClick=\"window.location='list.php'\" value=\"Back\"></p>";

include 'lib/closedb.php';


Return current item: XMasDB