gpt4 book ai didi

php - 如何包含文件php

转载 作者:行者123 更新时间:2023-11-28 17:17:11 24 4
gpt4 key购买 nike

我在包含 php 文件时遇到问题

PagePrevie.php :

<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="Style/css/bootstrap.min.css" />
<script src="Style/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="Style/css/Header-Picture.css">
<link rel="stylesheet" href="Style/css/Footer-with-logo.css">
<title></title>
</head>
<body class="container lg-warning">
<?php
include 'include/LogoUMBB.php';
include 'include/Header.php';
?>
<div class="container bg-success text-primary" style="width:500px;padding: 20px;">
</div>
<br />
<?php
include 'include/Footer.php';
?>
</body>
</html>

问题是这个文件所在的目录包含其他具有相同代码的网页

文件结构如下:

enter image description here

最佳答案

PHP 告诉您您的路径不正确,添加“../”以便您获得正确的包含路径。

    include '../include/LogoUMBB.php';
include '../include/Header.php';
include '../include/Footer.php';

关于php - 如何包含文件php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43436350/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com