보내는 쪽
<script type="text/javascript">
function send() {
$.post(
'receive_dom.php',
{ data: $("#data").html() },
function( output ) {
$('#output').html( output );
}
);
}
</script>
받는 쪽
<?php
$data = $_POST['data'];
$num = 15365;
$dir = intval($num / 1000);
mkdir( $dir, 0777 );
$file = $num - $dir * 1000;
$filename = $dir . "/" . $file . ".html";
file_put_contents( $filename, $data );
?>