The form is something simple like
<head>
</head>
<body>
<form action="creador.php" method="post">
<input type="text" name="datos" id="datos" />
<input type="submit" name="formSubmit" value="Submit" />
</form>
</body>
and the php script is also simple
$datos1=_POST("datos");
$html= aquí va la página web y en mitad de código me gustaría meter el datos1
file_put_contents('C:\xampp\htdocs\prueba2\Pagfinal.html', $html);