I’m pretty much a total newbie and have extremely limited code knowledge. I’m creating a website with a boostrap front end, wysiwyg type. I want to create a navbar that will be used on all pages on the site, and am trying to figure out how to use the php include function to allow the server to populate the navbar on all the webpages.
I’ve created a “Navbar.php” file that includes a boostrap navbar only, no css styling.
I’ve created a test webpage “test.php” that only has a paragraph and some text in it.
I have placed this code directly under the in the test.php file, since I want the navbar to be at the top:
<?php include("Navbar.php"); ?>The problem I’m having is that as soon as I save the test.php file with the php include, the php syntax changes in the code to:
and the php include does not work live. The test.php is not updated with the navbar.
However, when I include a css file in the php include on the test.php file the styling comes through just fine.
The code I use for the css php include is:
What am I missing to get the Navbar.php to be included in test.php?