We're completely redoing our website, and putting most of our pages into a new CMS (Adobe cq5- on server 

1). However, we have some php/mysql pages that cant go in there, so we are housing them on our own server(server2). I need our pages on server2 to look exactly like the page on server1.

There is a template on Server 1, with a url of:
<http://staging-cms.com/content/directory/template.html>

So, I need to  

1.pull the template from Server1 using the above URL.
2.Look in that template for this div:

`<div class="text"><p>CONTENT FOR TEMPLATE GOES HERE.<br></p></div>`

3.Take the content of the page on server 2 and insert it at the above point.
4. Return the full page, with template and contents onto a page on server2.

So, the final url would be something like:
`http://server2.com/books.php`

Is this possible?

I've tried this below, but all I get is a page with
databases.php printed.

```
$Content = file_get_contents("http://staging-cms.uc.edu/content/libraries   /template.html");
$Content = str_ireplace('CONTENT FOR TEMPLATE GOES HERE','databases.php','What goes here??');//staging-cms.uc.edu/content/libraries/template.html);
print ($Content);`

```

I've tried other things where I can return the template (kind of). But I cant seem to get it all working together?