2
我尝试指派动态独家元标签为每个页面动态元标签:基于URL
即: url.com/index.php?action=signup
包头 - 注册名称
关键词 - 注册关键词元
描述 - 注册说明
url.com/index.php?action=about
页眉 - 关于标题
关键词 - 关于关键词元
描述 - 关于描述
你得到了点。
我正在使用数组...但还没有想通如何分配每个数组到每个页面。
CONF.PHP
<?php
$metas = array(
'index.php' => array(
'header' => 'Home Title',
'keywords' => 'Home Meta Keywords',
'description' => 'Home Meta Description'
),
'signup' => array(
'header' => 'Signup Title',
'keywords' => 'Signup Meta Keywords',
'description' => 'Signup Meta Description'
),
'about' => array(
'header' => 'About Title',
'keywords' => 'About Meta Keywords',
'description' => 'About Meta Description'
)
);
?>
的index.php
<TITLE><?php echo $metas['title']; ?></TITLE>
<meta name="description" content="<?php echo $metas['description']; ?>" >
<meta name="keywords" content="<?php echo $metas['keywords']; ?>" >
如何分配这些值到每一页???
但是,如何将index.php数组放在index.php中?注册 - index.php?action =注册/ ABOUT - index.php?action =关于...等 – Darkeden
请参阅上面的修改。 – Dharmavir
我使用开关方法来分配值。 但现在我有分配变量的问题从MySQL选择...我怎么能做到这一点? 例如: url.com/news/$id/$title - 如何在这种情况下分配元标签? – Darkeden