public function newpage($var) { if (count($_POST) > 0) { $result = $this->db->query("\n\t\t\t\tINSERT INTO lf_forms (`id`, `author`, `title`, `content`, `email`)\n\t\t\t\tVALUES (\n\t\t\t\t\tNULL, \n\t\t\t\t\t" . $this->request->api('getuid') . ", \n\t\t\t\t\t'" . htmlspecialchars($_POST['title'], ENT_QUOTES) . "', \n\t\t\t\t\t'" . $this->db->escape($_POST['content']) . "', \n\t\t\t\t\t'" . $this->db->escape($_POST['email']) . "'\n\t\t\t\t)"); redirect302($this->lf->appurl . 'edit/' . $this->db->last()); } include 'view/admin_forms.newpage.php'; }
public function addcat() { if (count($_POST) > 0) { $result = $this->db->query("\n\t\t\t\tINSERT INTO blog_threads (`id`, `category`, `title`, `content`, `owner_id`, `date`)\n\t\t\t\tVALUES (\n\t\t\t\t\tNULL, '" . $this->db->escape($_POST['category']) . "',\n\t\t\t\t\t'New " . $this->db->escape($_POST['category']) . " article', \n\t\t\t\t\t'New Content',\n\t\t\t\t\t" . $this->request->api('getuid') . ",\n\t\t\t\t\tNOW() \n\t\t\t\t)\n\t\t\t"); } redirect302(); }
function fastphp_run_action($actionkey) { global $__ACTION_KEY_ALIAS; $module = "Default"; $action = "Home"; $method = "Index"; $actionkey = trim($actionkey); if ($actionkey != "") { //检查别名actionkey别名表 if (isset($__ACTION_KEY_ALIAS[$actionkey])) { $config = $__ACTION_KEY_ALIAS[$actionkey]; if (!empty($config['Module'])) { $module = $config['Module']; } if (!empty($config['Action'])) { $action = $config['Action']; } if (!empty($config['Method'])) { $method = $config['Method']; } } else { $tmp = explode('.', $actionkey, 2); if (count($tmp) > 1 && !empty($tmp[1])) { $method = $tmp[1]; } if (!empty($tmp[0])) { $action = $tmp[0]; if (strpos($action, "_") > 0) { $tmp = explode('_', $action, 2); $module = $tmp[0]; $action = $tmp[1]; } } } } if ($module != "Default") { $action = $module . '_' . $action; } $action .= "Action"; //Create Action Class $obj = new $action(); if (defined("__RUN_UNIX_MODE") && __RUN_UNIX_MODE && $action != get_class($obj)) { $msg = "[FastPHP] not exists action: {$action} (similar action: " . classget_class($obj) . ")"; logError($msg); redirect302(__HOME_URL . "notfound.php?msg=" . urlencode($msg)); } $obj->execute($method); }