0

我的 Xampp 服务器正在运行,现在也可以在子目录中运行我的 html(子目录名称中不能有空格)。

SSI 包含或 PHP 包含:

Xampp 说 SSI 已停用。尝试取消注释包含的行,但它不会更改停用。

如何激活 SSI?

那么,如何在我的 html 中实现 SSI 包含语句或 PHP 包含语句以调用包含 html、图像、javascript 和调用其他 javascript 菜单文件的命令的 html 文件?

4

3 回答 3

1

我不知道 Xampp 是否有激活 SSI 的特殊方式,但正常的 Apache 方式应该可以工作。

在 SSI 中包含文件的正常方法是

<!--#include virtual="/something/file.html" --> 

该文件的网址实际上是http://www.example.com/something/file.html

于 2008-11-24T05:36:12.217 回答
0

If XAMPP says SSI are disabled by default, you need to edit your server configuration (not your .HTACCESS file) to change this. Otherwise, you could try installing a plugin for your server to fix the issue.

Hope this helps!

~ Nate.

于 2013-04-02T06:11:19.193 回答
0

PHP 包含非常简单。只需将您的文件命名为 something.php 并执行以下操作:

<?php include('path/to/file.php'); ?>

该文件将由 php 解析,因此它可以包含 PHP/HTML 标记的标准组合或您想要的任何其他文本。

于 2008-12-21T17:12:43.263 回答