Let's say I have two websites. A Java web app running at www.server100.com, and a PHP web app running at www.server200.com.
Let's say I have a servlet http://www.server100.com/webapp1/getImageServlet
that returns the following HTML content, where the filename in the html (ABC123.jpg
) is a different filename for every hour of the day:
<div id="dynamicImage">
<img src="http://www.server100.com/ABC123.jpg">
</div>
Now, let's say I have a PHP file here: http://www.server200.com/test1.php
. How do I include the HTML that results from the servlet in my PHP file?
I'm thinking I want to do something like ...
<?php
Print "<html><body>";
Print "Hi! Let's see this hour's image!";
include "http://www.server100.com/webapp1/getImageServlet";
Print "</body></html>";
?>
Any ideas are greatly appreciated! And would it simplify things if the Java app and the PHP app were running on the same server? Thanks!