我正在按照教程here使用PHP添加另一种语言到我的网站 . 我遇到的问题是href链接无法正常工作 .

我有一个header.php文件

<header id="header">
    <nav class="navbar navbar-inverse" role="banner">
        <div class="container">

                <ul class="nav navbar-nav">
                    <li><a href="index.php"><?php echo $lang['MENU_HOME']; ?></a></li>
                    <li><a href="startup.php"><?php echo $lang['MENU_STARTUP']; ?></a></li>
                    <li><a href="projects.php"><?php echo $lang['MENU_PROJECTS']; ?></a></li> 
                    <li><a href="about-us.php"><?php echo $lang['MENU_ABOUT']; ?></a></li>
                    <li><a href="contact-us.php"><?php echo $lang['MENU_CONTACT_US']; ?></a></li>                        
                </ul>

        </div><!--/.container-->
    </nav><!--/nav-->
</header><!--/header-->

我加载到我的index.php,about-us.php,contact-us.php等...每个页面使用

<?php include('includes/header.php'); ?>

问题是我需要href链接到index.php?lang = en来查看我的英文主页和index.php?lang = fr来查看我的法语主页 . 由于两个页面共享相同的头文件,当我选择我的主页选项卡时,两个页面都链接到index.php而不是index.php?lang = en或index.php?lang = fr . 我该如何解决?

另一个相关问题,我有一个footer.php文件,包含在我的所有页面中

<footer id="footer" class="midnight-blue navbar-bottom">
    <div class="container">
        <div class="row">
            <div class="col-sm-12"><a href="index.php?lang=en""><u>EN</u></a> | <a href="index.php?lang=fr""><u>FR</u></a> </div>

        </div>
    </div>
</footer><!--/#footer-->

当我在不同的页面(about.php)时,我想翻译我所在的页面而不是index.php . 我该怎么做呢?