I have a php+ajax script that uploads a photo and throws the file name as a string into an iframe. When I echo the filename into my target iframe, it overwrites everything in the 'head' and 'body', which is causing some errors to appear because an important crossdomain script is no longer there.
Here's how the page starts (cleaned version)
<html>
<head>
<script type="text/javascript" src="crossdomain.js"></script>
</head>
<body>
<img src="images/profile-thumbnail-default.jpg" width="50" height="50" border="0">
</body>
</html>
Here's how its written:
<?php require ('html-header.php'); ?>
<img src="images/profile-thumbnail-default.jpg" width="50" height="50" border="0">
<? require ('html-footer.php'); ?>
When my upload script is complete, it overwrites the entire page and I end up with just this
<html>
<head>
</head>
<body>
0923898377309284.jpg
</body>
</html>
How can include my php includes to my output? I thought about heredoc but I can't get it work and I can't find an example using functions likes require.
How can I accomplish this? Here's what I have tried:
$html = <<<EOD require ('html-header.php');
$i->getFile();
require ('html-footer.php');
EOD;
echo $html;
exit();
Thoughts?