<html>

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

<body>

<div id="container">

	<div id="header">
	<! header picture in css >
	</div>
	
	<div id="navigation">
		<?php include 'navigation.php'; ?>
	</div>
	
<div id="aside">	
<br><br>
<form method="LINK" action="films2.php">
<input type="submit" value="Back to list">
</form>
</div>

<div id="content">
	
<?php

echo "<h1>Films Details</h1>";
echo "<br>";
$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;
}

$query=Mysql_query("SELECT * FROM php_films WHERE filmid=$id ");
$row=mysql_fetch_object($query);
echo mysql_error();

//get the value of each column and add to local variables
$filmofficialurl = $row->filmofficialurl;
$filmtrailer = $row->filmtrailer;

//display the film record in a html table

echo"<table border='1'>";
echo "
<tr bgcolor='#e1e0e0'><td width='150'><b>Name</b></td><td width='300'> $row->filmtitle </td></tr>
<tr bgcolor='#f7f7f7'><td width='150'><b>Year made</b></td><td width='300'> $row->filmyear </td></tr>
<tr bgcolor='#e1e0e0'><td width='150'><b>Rating of film</b></td><td width='300'> $row->filmrating </td></tr>
<tr bgcolor='#f7f7f7'><td width='150'><b>Description</b></td><td width='300'>$row->filmdesc </td></tr>
<tr bgcolor='#e1e0e0'><td width='150'><b>Trailer</b></td><td width='300'><iframe width='300' src=$filmtrailer frameborder='0' allowfullscreen></iframe></</td></tr>
<tr bgcolor='#f7f7f7'><td width='150'><b>URL</b></td><td width='300'><a href=$filmofficialurl> $row->filmofficialurl </a></td></tr>
<tr bgcolor='#e1e0e0'><td width='150'><b>Certificate</b></td><td width='300'> $row->filmcert </td></tr>
";
echo "</table>";
?>


</div>

<div id="footer">
Copyright &#169; Istvan Franko, 2014
</div>


</div>

</body>
</html>
