getContext()->getRequest(); $id = trim($request -> getParameter('id')); $sel = $db -> selectarray('select id,keyword from lkt_hotkeywords where id='.$id); if(!empty($sel)){ $id = $sel['0']['id']; $sel = $sel['0']['keyword']; } $request -> setAttribute("id",$id); $request -> setAttribute("sel",$sel); return View :: INPUT; } public function execute() { $db = DBAction::getInstance(); $request = $this->getContext()->getRequest(); $id = intval(trim($request -> getParameter('id'))); $name = addslashes(trim($request -> getParameter('name'))); if($name !== ''){ $sql = 'update lkt_hotkeywords set keyword="'.$name.'" where id='.$id; $res = $db -> update($sql); if($res > 0){ header("Content-type:text/html;charset=utf-8"); echo ""; } }else{ header("Content-type:text/html;charset=utf-8"); echo ""; } return; } public function getRequestMethods(){ return Request :: POST; } } ?>