I think that your code should be, one way or another, I do not know that the php code is in a separate file and the html / tpl code in a separate file.
if ($_GET['action'] == 'edit' && $_GET['id']) { $sel_cat =$cate_id ; } else { $sel_cat = ""; } construct_cat_ops($sel_cat); $tmpl->setvar('cat_ops', $cat_ops); <select name="category" class="field" style="width:160px" > <option value="0">Select</option> {var name='cat_ops'} </select>
source share