Reputation: 161
I have a problem that I know many people must know the answer to, but I am afraid I am still a bit of a beginner with these things.
I have been asked to make data on of my pages on one of our sites, available to another one of our sites (different servers) The data is pulled from a MySQL server using php.
I have been told of iFrame but I think what I am looking for is
<?php
$othersite = file_get_contents('http://www.othersite.com');
echo $othersite;
?>
I know that this is possible because there is a file on our site that is a simple table populated by php from a database table (connection to database is an include file with the credentials) and it has been shared with a different site that has somehow embeded it into their page and it displays data live from our table.
Unfortunaley the person who originally set this up is not available.
Is the file_get_contents
the answer I am looking for?
ANy help would be greatly appreciated.
Cheers Al.
Upvotes: 1
Views: 222
Reputation: 10588
It depends a lot on how you want to integrate, but I would actually recomment using an HTML <iframe>
for this purpose. Clean integration, clean security separation.
Upvotes: 1