0
這是我的index.php文件如何製作標題和側邊欄?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<?php
include('includes/header.php');
include('includes/sidebar.php');
include('includes/content.php');
include('includes/footer.php');
?>
</body>
</html>
這是代碼爲我的sidebar.php
<div id="sidebar">
<ul id="list">
<li><a href="index.php" class="sidebar">Home</a></li>
<li><a href="flower.php" class="sidebar">flower</a></li>
<li><a href="study.php" class="sidebar">Study</a></li>
<li><a href="calendar.php" class="sidebar">Calendar</a></li>
<li><a href="diary.php" class="sidebar">Diary</a></li>
</ul>
如果我點擊的花,它會去flower.php。我沒有包含頁眉,側邊欄和頁腳,並且發現它僅顯示flower.php的內容,不顯示頁眉,側欄和頁腳。有什麼方法可以讓它顯示?或者我應該再次寫下下面的所有代碼?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<?php
include('includes/header.php');
include('includes/sidebar.php');
include('includes/content.php');
include('includes/footer.php');
如何使用鏈接像< eis
也許你應該使用php表單並將它包含在同一個文件中。 – Monica
AJAX內容注入?也許? –