Kav*_*dhi 5 html javascript php wordpress jquery
我试图使用php为博客类别创建一个下拉框,在编辑类别表单时,它不应该显示我需要在类别表单中更新的现有类别名称.
示例我有一个类别下的产品电子产品我有笔记本电脑和手机,如果我在下拉框中更新手机移动选项不应该显示在此先感谢
<select name="category" class="field" style="width:160px" >
<option value="0">Select</option>
{var name='cat_ops'}
</select>
if ($_GET['action'] == 'edit' && $_GET['id']) {
$sel_cat =$cate_id ;
} else {
$sel_cat = "";
}
construct_cat_ops($sel_cat);
$tmpl->setvar('cat_ops', $cat_ops);
Run Code Online (Sandbox Code Playgroud)
if ($_POST['update'] && $_POST['hid_id']) {
if($brand==$categoryname){
$msg = "Parent category cannot be same";
$tmpl->setvar('msg_err', $msg);
}else{
$db->query("Update `blog_category` set`name`='$brand',`parent`='$category' where id='" . $_POST['hid_id'] . "'");
$msg = "Blog category Updated Successfully";
$tmpl->setvar('msg_ok', $msg);
$tmpl->setvar('name', $brand);
}
}
Run Code Online (Sandbox Code Playgroud)