include virtual & File

本文讲解了在服务器端包含文件时如何使用虚拟和文件关键字。虚拟关键字用于指示从虚拟目录开始的路径,而文件关键字则用于指示相对于包含文件的目录的相对路径。文章通过实例演示了如何使用这两种关键字。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The Virtual Keyword

Use the virtual keyword to indicate a path beginning with a virtual directory.

If a file named "header.inc" resides in a virtual directory named /html, the following line would insert the contents of "header.inc":

<!-- #include virtual ="/html/header.inc" -->

The File Keyword

Use the file keyword to indicate a relative path. A relative path begins with the directory that contains the including file.

If you have a file in the html directory, and the file "header.inc" resides in html\headers, the following line would insert "header.inc" in your file:

<!-- #include file ="headers\header.inc" -->

Note that the path to the included file (headers\header.inc) is relative to the including file. If the file containing this #include statement is not in the html directory, the statement will not work.


转载于:https://www.cnblogs.com/netwenchao/archive/2009/03/24/1420272.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值