远程访问.asp子例程 [英] Accessing .asp subroutines remotely

查看:71
本文介绍了远程访问.asp子例程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我需要从子域访问.asp子例程文件。


即该网站位于 www.domain.com 我想在子域mobile.domain.com上访问相同的子程序。


正常的#include和#virtual似乎没有远程工作。 />

我也尝试过:


url =" http://< domain> /subroutines.asp"

set xmlhttp = CreateObject(" MSXML2.ServerXMLHTTP")

xmlhttp.open" GET",url,false

xmlhttp.send ""

Response.write xmlhttp.responseText

设置xmlhttp =没有


并且它没有错误,但是子程序似乎无法进入。


想法?谢谢。

解决方案

实际上听起来像是服务器问题。让我请一位IIS专家来衡量一下。


Jared


是的,这将是一个服务器问题,因为这样的包含标签被称为服务器端包含或SSI。您是否可以访问服务器目录结构,还是在某个位置上传到远程服务器?这很重要,如果是后者,则可能会对您可以使用的内容以及如何使用它进行某些限制。比如使用各种文件扩展名等。

听起来好像你正试图在目录结构上向上移动。 < ;! - #include virtual =" ../ header.html" - >

所以它可能就像一个简单的..或../../一样简单,根据文件所在的位置移动两个目录可能需要一个完整的路径名即使它真的取决于服务器及它们对它的限制以及文件所在的位置与调用它的文件有关。


这里有一个可能有帮助的链接。 br /> http://www.w3schools.com/asp/asp_incfiles.asp


我查看了您的回复并测试了您的建议。问题是我的子域,即使它物理上位于子目录中,也被视为一个完全独立的实体。因此,我无法通过相对路径访问子例程文件。 (


<! - #include file =" ../ ActionFiles / subroutines.asp" - >


给出错误:


包含文件''../ ActionFiles/subroutines.asp''不能包含''..''来表示父目录。





我上传到带有共享软件包的远程服务器,所以我无法控制服务器变量。是否有一个设置我可以请求支持更改以允许我包含一个远程文件?


在我看来,问题更多的是.asp代码不会执行。它通过MSXML2.ServerXMLHTTP对象读取文件,如果我取消< %%> asp标签它会显示实际文本。它只是不允许我使用子程序。


有没有一种方法可以指定读入文件尽早执行以便在页面中使用这些子程序?

Hi,

I need to access an .asp subroutine file from a subdomain.

i.e. the website is at www.domain.com and I want to access the same subroutines on the subdomain mobile.domain.com.

The normal #include and #virtual don''t seem to be working remotely.

I have also tried:

url = "http://<domain>/subroutines.asp"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.responseText
set xmlhttp = nothing

and it doesn''t error out, but the subroutines don''t seem to be accessible.

Ideas? thanks.

解决方案

actually sounds like a server issue to me. Let me ask an IIS expert to weigh in.

Jared


Yes this would be a server issue as an include tag such as this is called a Server Side Include or SSI. Do you have access to the servers directory structure or are you uploading to a remote server someplace? This is important, if it is the latter then there may be certain restrictions on what you can use and how you can use it. Such as using various file extensions and such.
It sounds as though you are trying to move up on the directory structure as such. <!--#include virtual="../header.html" -->
So it may be as simple as that a simple .. or ../../ for moving up two directories depending on where the file resides the server may require a full path name even it really depends on the server and the restrictions that they put on it and where the file resides in relation to the file that calls it.

here is a link that may help.
http://www.w3schools.com/asp/asp_incfiles.asp


I have looked through your reply and tested out your suggestions. The problem is that my subdomain, even though it is physically located in a subdirectory, is treated as a completely separate entity. Therefore I can''t access the subroutine file through a relative path. (

<!-- #include file ="../ActionFiles/subroutines.asp" -->

gives the error:

"The Include file ''../ActionFiles/subroutines.asp'' cannot contain ''..'' to indicate the parent directory. "

)

I am uploading to a remote server with a shared hosing package, so I don''t have control over the server variables. Is there a setting I could ask support to change to allow me to include a remote file?

It looks to me like the problem is more that the .asp code won''t execute. It does read in the file through the MSXML2.ServerXMLHTTP object, and if I take off the <% %> asp tags it will display the actual text. It just won''t allow me to use the subroutines.

Is there a way I can specify for the read-in file to execute early enough to use those subroutines in the page?


这篇关于远程访问.asp子例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆