Website - (Page name (Home/About/Contact))
So if I went to the "About Us" page, it would change the title to Website - About Us. But I'm having a bit of trouble with the variable, as it doesn't update no matter what I do/change. My simple file is below if anyone is able to help.
<html>
<head>
<?php global $pageTitle; ?>
<title><?php echo $pageTitle; ?></title>
</head>
<body bgcolor="black" />
<?php
echo("<center><a href=\"index.php\" /><font color=\"white\" />Home</font></a> · <a href=\"?page=about\" /><font color=\"white\" />About us</font></a></center>");
if (!isset($_GET['page'])) {
$pageTitle = "Home";
echo("Sup");
} else {
$page = $_GET['page'];
switch($page) {
case 'about':
$pageTitle = " - About Us";
echo("About");
break;
case 'services':
echo("Services");
break;
case 'gallery':
echo("Gallery");
break;
case 'photos':
echo("Photos");
break;
case 'events':
echo("Events");
break;
case 'contact':
echo("Contact");
break;
}
}
?>
</body>
</html>

New Topic/Question
Reply



MultiQuote




|