<?php

$note_num = NULL;
if (isset($_GET['note'])) $note_num = $_GET['note'];

function fetch_note($note_num)
{
	$url = 'http://notes.dmclub.net/' . $note_num . '?dne_Template=easy';
 	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_HEADER, FALSE);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);	
	$html = curl_exec($ch);
	curl_close($ch);
	echo($html);
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>DNE dmNotes Embedding at its simplest</title>
	<link rel="stylesheet" type="text/css" href="dne.css" />
</head>
<body>
	
	<p>HEADER</p>
	<hr />
	
	<!-- EMBEDDED NOTE -->
	<?php fetch_note($note_num); ?>
	<!-- END EMBEDDED NOTE -->
	
	<hr />
	FOOTER
	
</body>
</html>