Originally posted by morrisoner
...how do i assign the generated HTML to a variable?
It depends on how you generate the HTML page.
If you write like:
$HTMLpage="<html>blabla</html>"
echo $HTMLpage;
This show the page and then you should write $HTMLpage's value into a file.
When you create/modify/delete a file, you work always server side.