Hi, templating is usually at least a 2 part process, often 3.
e.g. You have the actual template ..e.g.
then a routine for gathering the data to replace which might for example look like this..
then you can either just parse the tempate there and then, OR pass the data ($r) to a templating function or class.. the former...
$sql = mysql_query("
$r = mysql_fetch_assoc($sql);
how far you go with templating is another matter , my personal template class has simple IF and INCLUDE support and the ability to iterate through sections and auto-replace certain constants , some templating systems introduce nearly thier own language which I personally think is counter-productive but each to thier own.
$content = str_replace(
Anyways, thats the basics.