--- NoviTecaj.php 2001/04/20 08:25:32 1.1 +++ NoviTecaj.php 2001/04/25 13:18:46 1.2 @@ -9,21 +9,16 @@ $id = $id[0][0] + 1; $naziv = ISO_Win($naziv); DBQuery("INSERT INTO tecajevi (sifra,naziv,sif_qualification,language) VALUES ($id,'$naziv',$q,'$language')"); + $ret = $DBH->errstr; DBClose(); } - Header("Location: $oldpage"); - exit; + if (!$ret) { + Header("Location: $oldpage"); + exit; + } } - include("inc/Smarty.class.php"); - $tpl = new Smarty; - $tpl->template_dir = "./tpl"; - $tpl->compile_dir = "./tpc"; - $tpl->assign("action", $PHP_SELF.Params(-1, array("q" => $q))); - $tpl->assign("language", $language); - $tpl->assign("sifra", $sifra); + $tpl = new MySmarty(-1, array("q" => $q)); $tpl->assign("oldpage", $HTTP_REFERER); $tpl->assign("naziv", HTML_Escape(Win_ISO($naziv))); - $pg = basename($PHP_SELF); - $pg = eregi_replace("\.php$", "", $pg); - $tpl->display("$pg-$language.tpl"); + $tpl->show(); ?>