Hi Greg,
Many thanks, I never even thought about the idea of putting all of the meta data, css, title etc.. in the Header.html and just having the:
<?php
$allowed = array("Home","Contact","Sa
if(in_array($_GET["page"],
include("Header.html");
include($_GET["page"].".ht
} else {
die("Error Page Not On Approved List!");}
?>
in the site.php.
Using:
<title><?php echo $_GET["page"];?> - My Company Name</title>
now gives me titles like:
Home - My Company Name
Contact - My Company Name
etc...
This is great and certainly is perfectly acceptable however if i wanted to have more custom title descriptions based on each page how would I go about doing this?
Many thanks one again.
Andy.
Main Topics
Browse All Topics





by: g105bPosted on 2009-10-22 at 05:03:28ID: 25633067
You can echo the title in the HTML head section even though it is not in the same document as where the array is declared. It is not only .php files that can include php code, and because you 'include' another file, the variables declared before the include statement will be available to the included file.
les"); $allowed)) { ml");
Inside site.php:
<?php
$allowed = array("Home","Contact","Sa
if(in_array($_GET["page"],
include("Header.html");
include($_GET["page"].".ht
} else {
die("Error Page Not On Approved List!");}
?>
Inside header.html:
<html>
<head>
<title><?php echo $_GET["page"];?></title>
</head>
...
Hope this helps,
- Greg.