RE: [PHP] How to include a page not on my host
| From: | Peter Benoit | Date: | Fri, 30 Jun 2000 15:48:03 +0000 |
| Subject: | RE: [PHP] How to include a page not on my host | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4047@lists.php.net to get a copy of this message | ||
When I try include or require I get:
Failed opening required 'http://www.xxxxxxxx.com/xxxx.html
(include_path='')
and when I try to use fopen I get:
The file exists!Resource id #1
My code:
<?
$filename = "http://www.xxxxxxx.com/xxx.html";
$fp = fopen($filename,"r");
if ($fp){
print"The file exists!";
}else{
print"The file does not exist";
}
echo $fp;
fclose ($fp);
?>
OR
<?
$tmp = "http://www.xxxxxxx.com/xxx.html";
require $tmp;
?>
Confused,
Peter
-----Original Message-----
From: Matt McClanahan [mailto:cardinal@dodds.net]
Sent: Friday, June 30, 2000 11:50 AM
To: Peter Benoit
Cc: php-general@lists.php.net
Subject: Re: [PHP] How to include a page not on my host
On Fri, 30 Jun 2000, Peter Benoit wrote:
> I've seen this done before, but I can't find the page anywhere! I'd like
to
> include a page that's not on my host into a page on my host.
include and require both accept http:// and ftp://
URL's. However, if
you're trying to include a PHP page on another host, be aware that when
you include or require it, the file will be included after it as been
parsed by the PHP engine on the remote server.
Matt