Ya lo resolví.
function cogerhtml(){
var variable = "<html><body>"+document.getElementById('body').inn erHTML+"</body></html>";
window.location.href = "html.php?variable=" + variable;
}
esa funcion en un button en un php con jquery, donde arrastro las imagenes, los div, con un draggable.
Y en el html.php...
<?php
if(isset($_GET['variable'])){
$var = stripslashes($_GET['variable']);
$m = fopen("archivo.php","wb+");
fwrite($m,$var);
fclose($m);
}
?>