Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过单击index.php中的header.php,coent.php如何更改为cotent1.php?_Php_Html_Menu - Fatal编程技术网

通过单击index.php中的header.php,coent.php如何更改为cotent1.php?

通过单击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

在index.php中,它包括以下3个页面

<?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.phpcontent.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>