If you have no option but to deliver static html, try consider using an AJAX call via JavaScript.
For example, in jQuery you could do something like this:
<html>
.
.
.
<body>
<!-- every other piece of html -->
<div id="your_php_results"></div>
<script type="text/javascript">
$(function() {
$.get('xxx.php', function(data) {
$('#your_php_results').html(data);
});
});
</script>
</body>
</html>
xxx.php
is the relative path or absolute URL to xxx.php
.
In this implementation, xxx.php
must generate HTML which is then placed in the div
. What the jQuery $.get
-call does is that it requests the location you specified in the first parameter and it gets all the output generated by the resource. For example if this was your php-File:
<?php
//xxx.php
$data = array('Apfel', 'Birne', 'Banane'); //this is just example data
?>
<ul>
<?php foreach($data as $fruit) : ?>
<li><?php echo $fruit ?></li>
<?php endforeach; ?>
</ul>
Then the generated output would be:
<ul>
<li>Apfel</li>
<li>Birne</li>
<li>Banane</li>
</ul>
This would be fetched by $.get
and the resulting HTML-File after the execution would be:
<html>
.
.
.
<body>
<!-- every other piece of html -->
<div id="your_php_results">
<ul>
<li>Apfel</li>
<li>Birne</li>
<li>Banane</li>
</ul>
</div>
<script type="text/javascript">
// ...
</script>
</body>
</html>
If JS is not an option, you are left with the iFrame variant, which also should work in all browsers, including IE.
EDIT: finer example.
@somnath: In IE, up to version 8 i still got `the webpage cannot be found...` error – Pam Apple Aug 08 '12 at 17:43