<?php ob_start(); #require 'connect.php'; ?>
<script type="text/javascript">
window.onload = function(){
document.getElementById('test').innerHTML = 'content by js.';
}
</script>
<?php $tp_script = ob_get_clean(); ob_start(); ?>
<?php $tp_title = 'template designer';?>
<div>hello template world</div>
<div id="test"></div>
<?php $tp_content = ob_get_clean(); include 'tpl.php'; ?>
tpl.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=x-windows-874">
<title><?php echo empty($tp_title)?'':$tp_title;?></title>
<?php echo empty($tp_script)?'':$tp_script;?>
</head>
<body>
<!-- template editable in dreamweaver -->
<?php echo $tp_content;?>
</body>
</html>
ไม่มีความคิดเห็น:
แสดงความคิดเห็น