That's pretty simple tasks.
Just create a form that accepts user's input and then submit the input to certain file u specified in action part.
Then, you could just use this input and create a file using file system functions.
Example:
<?php
$input=$_POST['textinput'];
$htmlinput="<html><head><title>Title</title></head><body>";
$htmlinput.=$input;
$htmlinput.="</body></html>";
$file="newhtml.html";
$fp=fopen($file,"w");
fputs($fp,$htmlinput);
fclose($fp);
?>
something like that. Oh yes, please re-check the code above, I simply created it to give you some idea.
HTH