Forum Moderators: open

Message Too Old, No Replies

Using VBScript to make a page things it's in another directory

         

midoriweb

12:04 pm on Feb 4, 2007 (gmt 0)

10+ Year Member



I'm not sure if this is possible. I've searched around and I couldn't find and answer to my question.

I have a website... let's say it's:

[mysite.com...]

On my website I have a page:

[mysite.com...]

Now... I need that page to "think" it is actually:

[mysite.com...]

I'm running some software in "/directory1/" and I need to grab some of that information and put it into the root of my website. The problem is, the software has a license and it will only allow me to call from this application within the directory1 folder.

So... my question... can I use vbscript to make [mysite.com...] think it is actually [mysite.com...]

Inside of my current default.asp page on the root of my server I have the following code:

<!--#include file="directory1/default.asp" -->

And that's it. Would I be able to add some code above that line to make the server think the url is really in the directory1 folder? If not... what work around ideas can/should I check into?

defanjos

6:07 pm on Feb 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try calling the /directory1/ script into the root of your site using xmlHTTP, AspTear, or AspHTTP. I believe if you use any of those components the script will run under /directory1/, and not the root, like when you use the regular include.

midoriweb

12:39 pm on Feb 5, 2007 (gmt 0)

10+ Year Member



defanjos... thank you VERY much :)

I never knew about these little apps that could do what I needed. I installed AspTear (since it was the free one) and I got it working just like I need it to. Thank you again for the help :)

midoriweb

12:48 pm on Feb 5, 2007 (gmt 0)

10+ Year Member



Oops... just noticed something. It seems with ASPTear you can't use cookies on the page you're pulling from another directory on the same server. Or can you? Is there a way to support cookies as well? My code is the following:

<%
'AspTear constants
Const Request_POST = 1
Const Request_GET = 2

Set objTear = CreateObject("SOFTWING.ASPtear")
Response.ContentType = "text/html"

On Error Resume Next

Dim strRetval
' URL, action, payload, username, password
strRetval = objTear.Retrieve("http://www.mysite.com/directory1/Default_Frontend.asp", Request_GET, "", "", "")

Response.Write strRetval
%>