function startElement($parser, $name, $attrs) { GLOBAL $ce,$TMPL,$html; switch ($name) { case "INCLUDE": $html.=@implode("",@file($attrs["URL"])); break; } $TMPL[$name]=""; $ce=$name; } function endElement($parser, $name) { GLOBAL $ce,$TMPL,$result,$html; switch ($name) { case "RECORD": while ($D=mysql_fetch_array($result)) { $t=$TMPL["RECORD"]; $t=str_replace("__NAME__",$D["name"],$t); $t=str_replace("__EMAIL__",$D["email"],$t); $t=str_replace("__COMMENT__",$D["comment"],$t); $html.=$t; } break; } $ce=""; } function characterData($parser, $data) { GLOBAL $ce,$TMPL,$html; switch ($ce) { case "RECORD": $TMPL[$ce].=$data; break; default: $html.=$data; } }