<html>

<head>
<title>Films</title>
<link rel="stylesheet" type="text/css" href="css/guestbookform.css" />
</head>

<body>

<?php
$con = mysql_connect("localhost","******","******");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("******", $con);

//get the ID from the querystring.

$id=$_GET['id']; //get the value from the address bar
if(!is_numeric($id))
{ //check is a number.
echo "Sorry, there appears to have been an error.";
exit;
}

$sql = "DELETE FROM php_films WHERE filmid='$id' ";
echo $sql;

if (!mysql_query($sql,$con))
{
die ('Error: ' . mysql_error());
}

echo "<h1>1 record removed.</h1>";

//close the connection to the database.

mysql_close($con); 

?>

<br><br>
<form method="LINK" action="films2.php">
<input type="submit" value="Back to list">
</form>

</body>
</html>
