I am new to web development and am starting to learn php. I am wanting to make a website and am just working on small projects to learn different approaches.
I created a php file that contains the html information for the navbar so I can just include the php file and won't have to update every page that will have the navbar.
Here is my html file.
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="home.css">
<title id='title'>Homepage</title>
</head>
<body>
<?php include("menu.php"); ?>
<h1>Welcome to the homepage.</h1>
<h2>
<?php
echo "php is working";
?>
</h2>
<p>I will soon be update the page to look much nicer.</p>
</body>
</html>
Here is my php file.
<?php
echo <<< EOT
<div class="navbar navbar-static-top">
<ul class="nav">
<li class="home"><a href="index.html">Home</a></li>
<li class="about"><a href="#">About</a></li>
<li class="projects"><a href="#">Projects</a></li>
<li class="resume"><a href="#">Resume</a></li>
</ul>
</div>
EOT;
?>
When I open up the webpage none of it is working. But if I remove the php script that has the html and just insert the html in its place it works. I know php is installed correctly becuase the php script in h2 at the bottom of the file works.