【发布时间】:2009-08-26 22:06:07
【问题描述】:
假设我有以下页面:
# Include.asp
<%
Response.Write IsIncluded() & "<br>"
%>
# Outside.asp
<!--#include file="Include.asp" -->
我需要这样才能工作,如果我直接访问 http://Example.com/Include.asp,我会看到“True”,但如果我访问 http://Example.com/Outside.asp,我会看到 False。我宁愿不必向Outside.asp 添加任何内容。谁能想到在 ASP 中创建这样一个 IsIncluded 函数的方法?通过比较__FILE__ 和$_SERVER['PHP_SELF'],我能够在PHP 中创建这样的函数,但这在这里行不通,因为ASP 没有我知道的__FILE__ 之类的东西。
【问题讨论】:
标签: asp-classic include server-side-includes