Sunday, January 2, 2011

php - header and footer

Header Section:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 <title><?php echo $page['title'];?></title>
</head>

<body>

<!-- top menu bar -->
<table width="90%" border="0" cellspacing="5" cellpadding="5">
 <tr>
  <td><a href="#">Home</a></td>
  <td><a href="#">Site Map</a></td>
  <td><a href="#">Search</a></td>
  <td><a href="#">Help</a></td>
 </tr>
</table>
<!-- header ends --> 


Main Section:

<?php
// create an array to set page-level variables
$page = array();
$page['title'] = 'Product Catalog';

/* once the file is imported,
the variables set above will become available to it */


// include the page header
include('header.php');
?>

<!-- HTML content here -->

<?php

// include the page footer
include('footer.php');

?>


Footer Section:

<!-- footer begins -->
<br />
<center>
 Your usage of this site is subject to its published
 <a href="tac.html">terms and conditions</a>
 . Data is copyright Big Company Inc, 1995-<?php
 echo date("Y", mktime()); ?></center
</body>
</html>

No comments:

Post a Comment