-3

我已经为我的最新 Web 项目尝试了包含语句,但它不起作用

<script src="Additionl Pages/mm_css_menu.js"></script>
<link rel="stylesheet" type="text/css" href="Additionl Pages/Header.css" />

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
</head>
<?php
include('C:\wamp\www\Bank web\Additionl Pages\Header.html'); //header menu
?>
<?php
include('\wamp\www\Bank web\Additionl Pages\Slideshow\slideshow.html'); //slideshow
?>
<?php
include('C:\wamp\www\Bank web\Additionl Pages\logo.html');  //logo
?>
<body>
</body>
</html>
4

1 回答 1

2

尝试将您的 include 放置在您的 body 标签之间,如下所示:

PS:您忘记了开始html标签,并且您的scriptandlink标签位于您的 head 标签之间。您还忘记了C:\第二个包含的内容。我已经在下面修复了它。

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Home</title>
        <script src="Additionl Pages/mm_css_menu.js"></script>
        <link rel="stylesheet" type="text/css" href="Additionl Pages/Header.css" />
    </head>
    <body>
        <?php
        include('C:\wamp\www\Bank web\Additionl Pages\Header.html'); //header menu
        ?>
        <?php
        include('C:\wamp\www\Bank web\Additionl Pages\Slideshow\slideshow.html'); //slideshow
        ?>
        <?php
        include('C:\wamp\www\Bank web\Additionl Pages\logo.html');  //logo
        ?>
    </body>
</html>

编辑:也不需要有多个 php 标签。您可以在一个 php 标签中执行上述相同的操作,如下所示:

<?php
    include('C:\wamp\www\Bank web\Additionl Pages\Header.html'); //header menu
    include('C:\wamp\www\Bank web\Additionl Pages\Slideshow\slideshow.html'); //slideshow
    include('C:\wamp\www\Bank web\Additionl Pages\logo.html');  //logo
?>
于 2013-10-04T04:51:12.397 回答