PDA

View Full Version : trying to include remote file with php


mdo4
12-23-2002, 02:29 PM
Hello All:

I'm trying to include a file on another server with php4.3 and an Apache2 server using this syntax:

<?php include 'http://www/PageOne/default23.asp'; ?>

The file as you can see is an asp file. I'd ultimately like to include an asp file with a query string tagged on the end of it but for now I'm trying to simply get a remote file to get included. I tried other sites too like http://www.yahoo.com, no luck. Here's the error I get when tring this:

Warning: Failed opening 'http://www/PageOne/default23.asp' for inclusion (include_path='.;c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\import_test.php on line 2

Also, I installed PHP as a CGI rather than a module. Is there some sort of configuration I'm missing? Also, this might be noteworthy. I've tried this on my server at home, a unix box and I had success. I'm now trying it behind a firewall, which is where it will have to be and I'm having these problems, is there an inherent security measure used by php to prevent including files behind a firewall?

Thanks for any advice --Mike

Uranium-235
12-23-2002, 02:51 PM
are you running windows or *nix? and what PHP version?

transmothra
12-23-2002, 04:07 PM
it's probably the URL, and maybe something else, i'm not sure about including ASP into PHP. anyway, either make a relative("../includes/include.inc"), or an absolute ("http://yoursite.com/includes/include.php") path for it.