最新xoops模組開發
一、流程
- switch
	
  #---- 更新精選狀態 ----
  case "opUpdateChoice":
    opUpdateChoice();
    XoopsCache::clear();
    redirect_header($_SESSION['return_url'], 3, _BP_SUCCESS);
    exit;
	
 
二、函數
- opUpdateChoice()
	
#########################################
#  更新精選狀態
#########################################
function opUpdateChoice() {
  global $xoopsDB;
  #權限
  /***************************** 過瀘資料 *************************/
  $choice = intval($_GET['choice']);
  $sn = intval($_GET['sn']);
  /****************************************************************/
  //更新
  $sql = "update " . $xoopsDB->prefix("cnu_show_prod") . " set  `choice` = '{$choice}' where `sn`='{$sn}'";
  $xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'], 3, web_error());
  return;
}