Forum Moderators: coopster

Message Too Old, No Replies

can i include an asp file from another server?

         

bomburmusicmallet

3:34 pm on Apr 14, 2005 (gmt 0)

10+ Year Member



Hi, my first post.

Here's what I want to do. Open an index.php file on our (unix) server that does some processing, and in the middle of the page, I want to load something that is generated in asp but resides on another (windows) server.

Is it possible to include an asp file that is located on another server? What would be necessary to set up on that server? I haven't spoken to the other developer yet; I'd like to have some idea of what's possible/what I need to do first.

Thanks.

paladin

8:34 pm on Apr 14, 2005 (gmt 0)

10+ Year Member



Deending on the system you should be able to use the fopen() function to open and then parse the HTML of the remote ASP page.

-Alon

coopster

1:25 am on Apr 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, bomburmusicmallet.

Another option may be to just include() [php.net] the content you want from the remote server.

bomburmusicmallet

1:35 am on Apr 15, 2005 (gmt 0)

10+ Year Member



I tried the include, and got some ugly errors! Can an include statement be something like:

<? include 'http://www.server.com/page.asp?>

That is what I would need to do.

Thanks!

coopster

1:39 am on Apr 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It's right on that page that I linked


If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper ...

I noticed you are missing the ending quotation mark. Also, you may want to try using full tags rather than the short open tags.

<?php include 'http://www.server.com/page.asp' ?>