0
我試圖從php文件中的子文件夾中顯示代碼。在子文件夾php文件中顯示php文件
我試圖在子級索引頁上顯示頁眉和頁腳文件。
這裏是我的代碼: 的header.php:
<html>
<head>
<title>Mark VIII | Tommy Car Wash</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="http://www.domain.ca/base/website/" target="_blank" />
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
</head>
<body>
<div class="header">
<div class="header-content">
<div class="logo">
<a href="home.php">
<img src="images/logo.png" alt="" title=""/>
</a>
</div>
<div class="acc-cart-search">
<div class="acc-back">
<a href="#">Login</a>|<a href="#">Cart</a>
</div>
</div>
<div class="main-nav">
<nav class="nav">
<ul class="nav-list">
<li class="nav-item"><a href="store.php">Shop</a></li>
<li class="nav-item"><a href="#">Site Models</a></li>
<li class="nav-item"><a href="#">Equipment</a></li>
<li class="nav-item"><a href="#">Vacuum Systems</a></li>
<li class="nav-item"><a href="#">Detergents</a></li>
<li class="nav-item"><a href="#">Contact Us</a></li>
</ul>
</nav>
</div>
</div>
<div class="grw-bar"></div>
</div>
Footer.php:
<div class="footer">
<div class="footer-content">
<div class="grad-bar"></div>
<div class="creds">
<img src="images/usa.jpg" alt="" title="" />
<img src="images/bbb.jpg" alt="" title="" />
<img src="images/ica.jpg" alt="" title="" />
<img src="images/40-years.jpg" alt="" title="" />
</div>
<div class="address">
<address>
<strong>Tommy Car Wash Systems</strong><br>
581 Ottawa Ave. Suite 300<br>
Holland, Mi 49423<br>
USA
</address>
</div>
<div class="media-icons">
<a href="#"><img src="images/facebook.png" alt="" title="" /></a>
<a href="#"><img src="images/twitter.png" alt="" title="" /></a>
<a href="#"><img src="images/YouTube.png" alt="" title="" /></a>
<a href="#"><img src="images/blog.png" alt="" title="" /></a>
</div>
<div class="csd">
<img src="images/csd.png" alt="" title="" />
</div>
<div class="copy">
<p>© <?php echo date("Y") ?> Tommy Car Wash Systems. All rights reserved.</p>
</div>
</div>
</div>
</body>
</html>
而且我想上顯示的index.php我的信息的頁面:
<?php require (__DIR__ . '/header.php'); ?>
<?php require (__DIR__ . '/footer.php'); ?>
該頁面位於子文件夾網站模型下
「header.php」和「footer.php」文件中的代碼在找到解決特定問題的方法時不起作用。您應該已經提供了有關您的目錄結構的更多信息。 – 2014-01-08 10:04:44