Hi,
I've designed a website for a friend which has been built around a Dreamweaver template. The templates no good as they want to update the site themselves and have NO coding experince (HTML included) so I'd like to start again, this time using PHP to construct my template.
I'm relatively new to PHP and have had a good look around this forum but my main issue seems to be getting the individual content of each page into my template file.
I'd like to assign each page's content to a vaiable named $content which is called by the template.
Here's my template.php file:
<!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" />
<link rel="stylesheet" type="text/css" href="../css/mainstyle.css" />
<meta name="description" content="<?php echo $description; ?>" />
<meta name="keywords" content="<?php echo $keywords; ?>" />
<title><?php echo $title; ?></title>
</head>
<body>
<div id="border">
<div id="container">
<?php @include('header.php');?>
<div id="pageheader"><h2><?php echo $page_header; ?></h2></div><!-- end pageheader -->
<div id="content">
<div id="textarea"><?php include $content; ?></div><!-- end textarea -->
<div id="newsarea">
<?php @include('showcase.php');?>
</div><!-- end newsarea -->
<div class="clear"></div>
</div><!-- end content -->
<?php @include('footer.php'); ?>
</div><!-- end container -->
</div><!-- end border -->
</body>
</html>
Here's an example of one of the pages (eg: faq.php)
<?php
// Variables - change these to suit each individual page
$title = "page title here";
$description = 'description here';
$keywords = 'keyword1,keyword2';
$page_header = 'Frequently Asked Questions (FAQ)';
$content = content for site to go here. (will include html tags)
include('includes/template.php');
?>
I'm also having a problem with the site not applying the stylesheet that's attached to it.
Any help would be much appreciated.