嗨,大家好我正在为一个学校项目做一个网站,但为了保持有组织,我希望在一个文档中包含所有页面,并且当您访问该网站时,默认页面是索引。 PHP和其他页面链接如下:index.php?p=page
现在的问题是,我有这个脚本,但不知道我在哪里。我也不熟悉PHP,我从我的一个朋友那里得到了它。它是这样的:多个HTML页面在一个文件
?>
<php? some php code ?>
<html tag etc>
<head> Head stuff </head>
<Nav> <Header>
<php? some php code where I filled in what the link was of the content under it ?>
< The content of the page, excluding the header, navigator etc because that was above here. >
?>
Then I could do the same thing over and over again, and just change the PHP code and it worked.
<footer stuff>
</body>
</html>
我知道有很多这样的脚本,我搜索谷歌超过一个小时,但没有成功。
-Tristan
你正在寻找的东西是这样的:'如果(isset($ _ GET [ 'page'])&&($ _GET ['page'] =='something')' –
'
Barmar
现在我该如何把它放到网站中?你给我一个完整的例子,因为我是一个完整的PHP noob。 –