could you please tell what`s wrong with the end of this code and why it says: "Parse error: syntax error, unexpected end of file in php file":
<?php
define("DB_SERVER" , "localhost");
define("DB_USER" , "root");
define("DB_PASS" , "root");
define("DB_NAME" , "widget_corp");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title> CMS MANAGEMENT </title>
<link rel="stylesheet" type="text/css" href="stylesheets/style.css">
</head>
<body>
<header>
<h1> widget Corp <h1>
</header>
<?php
require("constants.php");
// mysql connection
$connection = mysqli_connect(DB_SERVER,DB_USER,DB_PASS);
if (!$connection){
die("Database Connection failed:". mysql_error());
}
// select database
$db_select = mysqli_select_db($connection , DB_NAME);
if (!$db_select) {
die("Database selection failed:" . mysql_error());
}
?>
<nav>
<ul class="subject">
<?php
$subject_set = mysqli_query($connection, "SELECT * FROM subjects" );
if (!$subject_set){
die("mysql failed" . mysql_error());
}
while ($subject = mysql_fetch_array($subject_set)){
echo "<li>{$subject["menu_name"]}</li>";
}
$page_set = mysqli_query($connection, "SELECT * FROM pages WHERE subject_id = {$subject["id"]}");
if (!$page_set){
die("Database query failed: " . mysql_error);
echo "<ul class=\"pages\">";
while ($page = mysqli_fetch_array($page_set)){
echo "<li>{$page["menu_name"]}</li>";
}
echo "</ul>";
?>
<?php echo "</ul>"; ?>
</section>
<?php mysqli_close($connection);?>
}
afterdie("Database query failed: " . mysql_error);
– cOle2 Jul 14 at 14:44if (!$page_set) {
– Robbert Jul 14 at 14:45