PHP Question about Includes

AdamDuritz99

Diamond Member
Mar 26, 2000
3,233
0
71
Ok, I was wondering if it is possible to include a php file from another server.

Example:

<?php

include('http://www.someserver.net/test.php');

//prints info from test.php file

print $info;

?>

so is that possible? If so what am i doing wrong? If not do i basically have to use fopen to retrieve data from another server?

peace
sean
 

kgraeme

Diamond Member
Sep 5, 2000
3,536
0
0
I use ColdFusion not PHP, and with CF this isn't possible. It's because the middleware processing happens before the http level, thus closer to the filesystem. Since a different web server is at a higher level, the middleware can't easily see it. What you can do though with CF is something called CFHTTP which uses a full http request, and you give it parameters in the file to look for using grep and it strips out the rest and includes it in the page. Perhaps PHP has a similar function.