Hello friends I am running 2 applications on the same server and I wanted to import some content of Application-1 into Application-2 and similarly some content of Application-2 into Application-2.
Currently this is how I am getting it:
<?php
$app1 = file_get_contents('http://localhost/cms');
file_put_contents('cms.html', $app1);
$app2 = file_get_contents('http://localhost/blog');
file_put_contents('blog.html', $app2);
?>
Like this I am saving these 2 files with the HTML of those applications
Now lets say I have
a <div id="header">
in cms.html
which I want to import in <div id="header">
of Application-2's index.php file
and
a <div id="footer">
in blog.html
which I want in <div id="footer">
of Application-1's index.php
file.
How do I do this?
UPDATE : Both applications are Joomla and WordPress.
My Template is a simple one without any JavaScript so kindly suggest a PHP solution until and unless it is compulsory to load JavaScript, I want to keep it simple and light.
Please also note I have just started learning programing hence It will be very difficult for me to understand too technical a language hence requesting a simple language. Hope you understand.
If my approach is wrong at the very first place, then please feel free to suggest a better method of doing this task.
Kindly help.
UPDATE 2 : Please not my issue is not of getting content from the other application. My issue is to get a fragment of the HTML file that is being generated.