I am very new to PHP and I kind of sort of want to create the pages like I would in ASP.NET; it's just the way I am wired. I have been inserting the header/menu using a PHP Include and here is what the code looks like for just the first page.
Am I doing this properly, or is there a better way?
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Jerusalem</title>
<link rel="stylesheet" type="text/css" href="Main.css"/>
</head>
<body>
<div id="wrapper">
<div id="header">
<?php include ('Menu.php') ?>
</div>
<div id="content">
<h1 class="PageTitle" >Sturgis Hellfighters</h1>
<div class="indexright" width="50%">
<h3 class="smallheader">Scripture Corner</h3>
<p><img src="images/Romans5-8.jpg" width="475" alt="Romans 5:8" /></p>
<p></p>
</div>
<div class="indexleft" width="50%">
<p><img src="images/BridalFallsSpearfishCanyon.jpg" width="475" height="720" alt="Bridal Falls Spearfish Canyon" />
</p>
</div>
</div>
</div>
</body>
</html>
Menu.php
<img src="images/SiteHeader.jpg" width="1000" height="150" alt="HellFighters New Jerusalem" id="siteheader"/>
<ul id="HomeMenu">
<li class="TopLevel"><a href="index.php">Home</a></li>
<li class="TopLevel"><a href="#">News</a>
<ul>
<li class="SecondLevel"><a href="#">Sturgis Current Events</a></li>
<li class="SecondLevel"><a href="#">Rapid City Events</a></li>
<li class="SecondLevel"><a href="#">Pierre Events</a></li>
<li class="SecondLevel"><a href="#">Other Events</a></li>
</ul>
</li>
<li class="TopLevel"><a href="#">Photos</a>
<ul>
<li class="SecondLevel"><a href="christmasatpineridge.php">Christmas On Pine Ridge</a></li>
<li class="SecondLevel"><a href="XmasMission.php">Christmas At the Mission</a></li>
<li class="SecondLevel"><a href="OpenHouse.php">Open House</a></li>
<li class="SecondLevel"><a href="Nationals.php">Nationals</a>
</ul>
</li>
<li class="TopLevel"><a href="#">Events</a>
<ul> <!-- -->
<li class="SecondLevel"><a href="#">A Pine Ridge Christmas</a>
<li class="SecondLevel"><a href="#">A Sturgis HellFighter Christmas</a>
<li class="SecondLevel"><a href="#">Sturgis Motorcycle Rally</a></li>
<li class="SecondLevel"><a href="#">Random City Swap Meet</a></li>
<li class="SecondLevel"><a href="#">Cool Event</a></li>
</ul>
</li>
<li class="TopLevel"><a href="#">Contact Info</a>
<ul>
<li class="SecondLevel"><a href="#">President</a></li>
<li class="SecondLevel"><a href="#">Vice-President</a></li>
<li class="SecondLevel"><a href="#">Preacher Man</a></li>
</ul>
</li>
</ul>
I would like to use HTML5 if possible, so if your review brings up HTML5 that is cool with me too.
If you would like to see the front page, click here.
This page will be changing as I am currently working on it.
<?php include ('Menu.php') ?>
I would think would generate a fatal error with the semicolon. \$\endgroup\$menu.php
doesn't contain any PHP, then change its extension to what it really is:html
. The php extension means your sever is passing the file to the PHP parser first, which doesn't do anything but take up more resources & slowing you down. the PHP extension is only required for files that contain code \$\endgroup\$