```
kind程式端
```
#定義常用變數
$TBL['name']="show_prod";//資料表名稱
$TBL['kind']="kind_prod";//分類
```
op\_form()
```
$DBV['kind'] = (isset($DBV['kind'])) ? $DBV['kind'] : "";
$DBV['kind_option'] = get_kind_prod_option($DBV['kind']);
```
```
########################################
# 得到商品類別選項
########################################
function get_kind_prod_option($kind="")
{
global $mysqli,$smarty,$TBL;
$sql = "select sn,title
from `show_kind`
where `kind`='{$TBL['kind']}' and `enable`='1' ";
$result = $mysqli->query($sql) or die(printf("Error: %s
".$sql, $mysqli->sqlstate));
$options="";
while($row = $result->fetch_assoc())
{
#過濾撈出資料
$row['sn'] = intval($row['sn']);
//http://www.w3school.com.cn/php/func_string_htmlspecialchars.asp
$row['title'] = htmlspecialchars($row['title'], ENT_QUOTES); // 轉換雙引號和單引號
$selected = ($kind == $row['sn'])?" selected":"";
$options .="\n";
}
return $options;
}
```
6. 多行
摘要 ```
```
內容(網頁編輯器) ```
```
7. 日期 ```
```
8. 上傳 ```
{if $DBV.file_name}
{/if}
```
9.