include file的问题,高分求助

CinnXu 2005-01-19 01:31:41
我有两个网站,http://asite,http://bsite,想再bsite里面include file asite的http://asite/head.asp页面,该怎么设置路径?老提示
找不到包含文件 'http://astie/head.asp'

...全文
136 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
avonqin 2005-01-19
  • 打赏
  • 举报
回复
include file 只能站内包含,且只能是相对路径

可以用xmlhttp

<%
hrefs = "http://astie/head.asp"
response.write PageTgdn(hrefs)

function PageTgdn(url)
Set Retrieval = Server.CreateObject("Msxml2.XMLHTTP")
With Retrieval
.Open "get",url,false
.Send
GetURL = .responseBody
End With
Set Retrieval = Nothing
msg=bytes2bstr(geturl)
PageTgdn = msg
end function

Function bytes2BSTR(vIn)
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
%>
潜水的鱼 2005-01-19
  • 打赏
  • 举报
回复
当然不行, 你只能用xmlhttp组件, 把head.asp运行后的结果包含进来;

如果两站点不在一机器上:
有一方法, 就是你把head.asp文件的代码, 写在xml文件里, 通过xml文件来进行互传;

如果两站点都在一机器上:
你可以通过fso组件, 利用绝对路径, 把head.asp里的代码读出并包含到你所需的文件里;
xx123731 2005-01-19
  • 打赏
  • 举报
回复
如果INCLUDE 不行的话,你用IFRAME 试试,肯定行

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧