嗨,大家好我正在爲一個學校項目做一個網站,但爲了保持有組織,我希望在一個文檔中包含所有頁面,並且當您訪問該網站時,默認頁面是索引。 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。 –