require "xtpl.p"; //include XTemplate engine

//don't need this - wrong.
> require "html.xtpl"; //html layout file with field names e.g. {firstfield}

You need to create a new instance of the Xtemplate class so:
//assign the new instance to a variable name you'll use - I called it
$template
//and I specified which "html layout file" to use.

$template = new Xtemplate("html.tpl"); // I name them tpl not xtpl *shrug*

while($row = mysql_fetch_array($result))
{
    $template->assign("FIELD1", $row[fieldname]);
    //FIELD1 being the name you're going to use in the layout file by
{FIELD1}
    //$row being the name of the array you fetched, field name being the
fieldname in the database

    $template->assign("FIELD2", $row[fieldname2]);

    $template->parse("main");//replace {field} with matching result row
element
    $template->out("main");` //send final html page to browser
}



Kristi


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to