我的菜单在我的一个目录中是一致的。例如,为包含的菜单创建if语句
首页 文档页 照片页
我希望能够有这样的菜单到每个网页,我会做。但是,这一次有点不同,因为即使目标是相同的,单个页面生成的链接也必须不同。就拿链接galleries.php页为例:
From the Home page: <a href='galleries.php?id=<?=$id?>'>
From the Documents page: <a href='galleries.php?id=<?=$doc[lid]?>'>
From the Photos page: <a href='galleries.php?id=<?=$photo[lid]?>'>
From the Productss page: <a href='galleries.php??id=<?=$product[lid]?>'>
>
我在做什么,现在是到菜单复制并粘贴到每个文件,并根据需要更改URL,但这不是一个非常令人满意的解决方案。我该如何在菜单中建立某种if语句,以便包含菜单的页面生成正确的链接?
Thanks new_developer。这两种方法之间有什么区别,我在选择它们时应该考虑什么? – Janie 2013-03-24 13:27:32
@Janie你问两个答案吗? – alwaysLearn 2013-03-24 13:29:09