線上書籍

Home

[1012]PHP進階開發及TadTools工具應用

<?php include_once "header_admin.php"; $parent_gsn=empty($_POST['parent_gsn'])?0:$_POST['parent_gsn']; echo get_cate_options($parent_gsn); function get_cate_options($parent_gsn){ global $xoopsDB ; $sql = "select `gsn` , `title` from `".$xoopsDB->prefix("contact_cate")."` where `parent_gsn` = '$parent_gsn' order by `sort`"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'] , 3, mysql_error()); $main=""; while(list($gsn , $title)=$xoopsDB->fetchRow($result)){ $main.="<option value='$gsn'>{$title}</option>"; } return $main; } ?>