<?php
// start the session
session_start();
// 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');
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">@import url("style.css");</style>
<title>X-Mas Gift Database</title>
</head>
<body>
<h2>X-Mas Gift Database</h2><br>
<?php
include 'config.php';
include 'lib/opendb.php';
if($_GET["cmd"]=="delete")
{
$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';
?>
</body>
</html>