<?php
require_once("classes.php");

//Start the session
session_start();

?>
<html>
<head>
<title>Remove an item</title>
</head>
<body>
<?php
if (!isset($_GET['item'])) {
	//Not all elements have been specified!
	//Redirect users to index.php
	header('Location: index.php');
	exit;
}

$item      = $_GET['item'];

echo '<h1>Remove from cart</h1>';

echo "<p>Too bad, you didn't want a <strong>$item</strong>!</p>";

// Remove the item from the $_SESSION['cart'] session variable
unset($_SESSION['cart'][$item]);

echo "<p>Your item has been removed from the cart.</p>";

echo "<a href=\"cart.php\">Go to cart!</a>";

?>
</body>
</html>
