} $this->setError('username', 'opf', 'invaliduser'); return false; } } try { require './include.php'; $tpl = new optClass(); $tpl->loadConfig('./config.php'); $tpl->setMasterPage('master.tpl'); $validator = new opfValidator(); $opf = new opfClass($tpl, $validator->defaultParams()); $opf->createI18n('./'); $form = new myForm($opf, 'form1'); if ($form->execute()) { $tpl->assign('username', $validator->username); $tpl->assign('email', $validator->email); $tpl->assign('age', $validator->age); $tpl->assign('content', $validator->content); $tpl->parse('report.tpl'); } else { if ($form->invalid()) { $tpl->assign('error_msg', 1); } $tpl->parse('test_forms_1.tpl'); } } catch (opfException $exception) { opfErrorHandler($exception); } catch (optException $exception) { optErrorHandler($exception); }