通过单击index.php中的header.php,coent.php如何更改为cotent1.php?
在index.php中,它包括以下3个页面通过单击index.php中的header.php,coent.php如何更改为cotent1.php?,php,html,menu,Php,Html,Menu,在index.php中,它包括以下3个页面 <?php include 'header.php'; ?> <?php include 'content.php'; ?> <?php include 'footer.php'; ?> 对于header.php,它是一个与所附图片类似的菜单 现在的问题是,单击菜单后,我希望content.php更改为另一个页面,如content1.php。否则content.php中的内容将发生更改。当单击header.ph
<?php include 'header.php'; ?>
<?php include 'content.php'; ?>
<?php include 'footer.php'; ?>
对于header.php,它是一个与所附图片类似的菜单
现在的问题是,单击菜单后,我希望content.php更改为另一个页面,如content1.php。否则content.php中的内容将发生更改。当单击header.php并且content.php将更改为content1.php或content.php中的内容时,这怎么可能发生在我的index.php中。php将更改为我想要的内容
请告知,我的电子邮件是andybusy@hotmail.com. 多谢各位
问候
安迪试试这个
<?php include 'header.php'; ?>
<?php if(isset($_GET['pagename']))
{
$pagename=$_GET['pagename'].'.php';
}
else
{
$pagename='content.php';
}
?>
<?php include $pagename; ?>
<?php include 'footer.php'; ?>
这是你的链接栏
<a href="index.php?pagename=content">page1</a>
<a href="index.php?pagename=content1">page2</a>
<a href="index.php?pagename=content2">page3</a>