Hi. I'm a novice in PHP and I'm using a code for my header and I was wondering how I would add a PHP script to it so that when it calls the selected page: main.php, about.php, etc it'll show up in the title after the | symbol. See this
site for example. Notice how whenever you click on the link the url bar reads
http://ottoid.com/pixeldistortion/?p=portfolio then the title reads Pixel Distortion / Portfolio. I want something to add to the PHP script I already have. Thanks for any help you guys can give me!
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
$path = getcwd() . '/content';
$extension = 'php';
$default = 'main';
function showError($msg) {
echo "<h1>Error</h1>\n";
echo " <span>" . $msg . "</span>\n";
}
function includeContentFile() {
global $path, $extension, $default;
$filename = isset($_GET['p']) ? $_GET['p'] : $default;
if (! $filename) {
showError('No page selected.');
return;
}
foreach (array('.', '/', '\\') as $illegal) {
if (false !== strpos($filename, $illegal)) {
showError('Illegal characters in page parameter.');
return;
}
}
$fullpath = realpath(sprintf('%s/%s.%s', $path, $filename, $extension));
if (! file_exists($fullpath)) {
showError('This page has not been created yet.');
return;
}
include($fullpath);
}
include('replacePngTags.php');
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title>BuiltNoble | The Upper Class of Webdesign™</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="keywords" content="BuiltNoble.com, builtnoble.com, BuiltNoble, builtnoble, shibbycookieofdeath, shibbycookies, jleemero" />
<meta name="description" content="The Upper Class of Web Design." />
<meta name="revist-after" content="2 days" />
<link href="/builtnoblev2/resources/css/main.css" rel="stylesheet" type="text/css" media="screen" />
<script src="/builtnoblev2/resources/js/zoom.js" type="text/javascript"></script>
</head><body onload="setupZoom()">