I am trying to dynamically change my page titles. I have the following script inside my header.php page
<?php $pagetitle = "Website Home"; ?>
<head>
<title><?php echo $pagetitle ?></title>
</head>
But instead of my page title displaying as "Website Home", the page title shows up as "<?php echo $pagetitle ?>
". Is there a reason why the php will not execute inside the <title>开发者_如何学编程;
tags?
you're calling your header.php some unusual way. Just include
it in other php script.
精彩评论