I am new to PHP. I am designing a website and would like to use the same header & footer throughout the site. It is my understanding I can take the header code and save it as a php file, then use a php include to pull it into each page.
I tried the process and it didn't work. When I look at the page source I see the php statement instead of the HTML code.
I am certain my web server has php. In order to install forum software I ran a pre-requisite check which confirm it. Also I tried running the following code:
What returned was a display page showing my PHP information.
I saved the below code as header.php
<img src="images/makati_condo_skyline.jpg" alt="Makati night view" width="960" height="212" />
<li class="selected"><a href=".">Home</a></li>
<li><a href="rent.html">Availability & Rates</a></li>
<li><a href="makati.html">Makati Info</a></li>
<li><a href="about.html">Contact Us</a></li>
In the body of my index.html file I added the following line:
<?php include("header.php"); ?>
My header did not appear, the source shows that exact line of code. Any ideas of what I am doing wrong?