我想为具有相同标题的每个页面添加不同的标题和说明
我已经使用了以下代码,但这似乎无法正常工作
<?php
$page = $_SERVER['PHP_SELF']; switch
($page)
{
case 'index.php':
$title= 'uHost | Unlimited Free Hosting' ;
$description = 'Free Web Hosting with Unlimited Disk Space, Unlimited Bandwidth, Unlimitted Database and Unlimited Websites from uHost. With PHP and MySQL and no forced ads on your site.';
$keywords = 'uhost,uHost,home,unlimitted free hosting,unlimitted disk space,unlimitted websites hosting,free cpanel hosting,hosting free,free hosting sites,domain,free domain';
break;
case 'login.php':
$title= 'Login | uHost';
$description = 'Login to your uHost control panel in order to change the settings of your website.';
$keywords = 'uhost,uHost,login,unlimitted free hosting,unlimitted disk space,unlimitted websites hosting,free cpanel hosting,hosting free,free hosting sites,domain,free domain';
break;
}
?>
我已将此保存为php文件并将其包含在我的标题中,并回显每个变量。
但这似乎不起作用
如果我设置默认情况,每个页面似乎都有相同的标题,描述等
如何解决这个问题?