<?php
function html_mod($page,$tag)
{
	switch($page)
	{
		case'index':
		$p = './html/index.html';
		break;
		case'about':
		$p = './html/about.html';
		break;
		case't':
		$p = './html/t.html';
		break;
		case'g':
		$p = './html/g.html';
		break;
		case'note':
		$p = './html/note.html';
		break;
		case'user':
		$p = './html/user.html';
		break;
		case'search':
		$p = './html/search.html';
		break;
	}
	$fp = fopen($p,'rb');
	$context = fread($fp,filesize($p));
	fclose($fp);
	$fp2= fopen('./html/h.html','rb');
	$top = fread($fp2,filesize('./html/h.html'));
	fclose($fp2);
	$fp3= fopen('./html/f.html','rb');
	$bt  = fread($fp3,filesize('./html/f.html'));
	fclose($fp3);
	$add['<##top##>']    = $top;
	$add['<##bottom##>'] = $bt ;
	$res= strtr($context,$add);
	$re = strtr($res,$tag);
	return $re;
}
?>