RedditPP Mascot

RedditPP

r/webdev • … • u/unimatrix_0

getting common headers on all pages

webdev noob here, so apologies if this is very simple for you.

I'm trying to make a simple site on a university-hosted server, so I can't change apache server settings and stuff. I would like to have a header that is common to all pages ( links to various portions of the site and such). I currently have copied the header html code to each page, which is annoying when I need to make a change.I have tried making a header.shtml with server side includes - that didn't work. I think the apache server isn't configured for that.

I have also tried making a header.php but can't get it to work. I must be missing something.

index.html code:

<header id="header">

<?php include './header.php'; ?>

</header>

&#x200B;

header.php:

<?php echo '<ul> <li><a href="index.html">Home</a></li> <li><a href="index.html#moo">moo</a></li> <li><a href="people.html">People</a></li> <li><a href="code.html">code</a></li> <li><a href="index.html#Contact">Contact</a></li>

</ul>'?>

&#x200B;

— 0