including php file from another server with php
- by ermac2014
hi
I have 2 php files each file on different server. lets say the first file called includeThis.php and the second called main.php
the first file is located in (http://)www.sample.com/includeThis.php
and the second located in (http://)www.mysite.com/main.php
so now what I want is to include the first file into my second file.
the contents of the first file is like:
<?php
$foo = "this is data from file one";
?>
the second file like:
<?php
include "http://www.sample.com/includeThis.php";
echo $foo;
?>
is there any way I can do this?
thanks in advance