本文整理汇总了PHP中fn_post函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_post函数的具体用法?PHP fn_post怎么用?PHP fn_post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_post函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mdl_dbconfig
function mdl_dbconfig()
{
if (!fn_token("chk")) {
//令牌
return array("alert" => "x030102");
exit;
}
$_str_dbHost = fn_getSafe(fn_post("db_host"), "txt", "localhost");
$_str_dbPort = fn_getSafe(fn_post("db_port"), "txt", "3306");
$_str_dbName = fn_getSafe(fn_post("db_name"), "txt", "baigo_cms");
$_str_dbUser = fn_getSafe(fn_post("db_user"), "txt", "baigo_cms");
$_str_dbPass = fn_getSafe(fn_post("db_pass"), "txt", "");
$_str_dbCharset = fn_getSafe(fn_post("db_charset"), "txt", "utf8");
$_str_dbTable = fn_getSafe(fn_post("db_table"), "txt", "cms_");
$_str_content = "<?php" . PHP_EOL;
$_str_content .= "define(\"BG_DB_HOST\", \"" . $_str_dbHost . "\");" . PHP_EOL;
$_str_content .= "define(\"BG_DB_PORT\", \"" . $_str_dbPort . "\");" . PHP_EOL;
$_str_content .= "define(\"BG_DB_NAME\", \"" . $_str_dbName . "\");" . PHP_EOL;
$_str_content .= "define(\"BG_DB_USER\", \"" . $_str_dbUser . "\");" . PHP_EOL;
$_str_content .= "define(\"BG_DB_PASS\", \"" . $_str_dbPass . "\");" . PHP_EOL;
$_str_content .= "define(\"BG_DB_CHARSET\", \"" . $_str_dbCharset . "\");" . PHP_EOL;
$_str_content .= "define(\"BG_DB_TABLE\", \"" . $_str_dbTable . "\");" . PHP_EOL;
$_num_size = file_put_contents(BG_PATH_CONFIG . "config_db.inc.php", $_str_content);
if ($_num_size > 0) {
$_str_alert = "y060101";
} else {
$_str_alert = "x060101";
}
return array("alert" => $_str_alert);
}
示例2: ajax_clear
function ajax_clear()
{
if ($this->adminLogged["alert"] != "y020102") {
//未登录,抛出错误信息
$this->show_err($this->adminLogged["alert"], "err");
}
if (!isset($this->adminLogged["admin_allow"]["media"]["del"])) {
$this->show_err("x070304", "err");
}
$_num_last = fn_getSafe(fn_post("last"), "int", 0);
$_num_perPage = 10;
$_num_mediaCount = $this->mdl_media->mdl_count("", "", "", "", 0, "normal");
$_arr_page = fn_page($_num_mediaCount, $_num_perPage, "post");
$_arr_mediaRows = $this->mdl_media->mdl_list($_num_perPage, 0, "", "", "", "", 0, "normal", false, 0, $_num_last);
if ($_arr_mediaRows) {
foreach ($_arr_mediaRows as $_key => $_value) {
$_arr_mediaRow = $this->mdl_media->mdl_chkMedia($_value["media_id"], $_value["media_ext"], $_value["media_time"]);
if ($_arr_mediaRow["alert"] == "x070406") {
$this->mdl_media->mdl_box("recycle", array($_value["media_id"]));
}
}
$_str_status = "loading";
$_str_msg = $this->obj_ajax->alert["x070407"];
} else {
$_str_status = "complete";
$_str_msg = $this->obj_ajax->alert["y070407"];
}
$_arr_re = array("msg" => $_str_msg, "count" => $_arr_page["total"], "last" => $_value["media_id"], "status" => $_str_status);
exit(json_encode($_arr_re));
}
示例3: ajax_order
function ajax_order()
{
if (!isset($this->adminLogged["groupRow"]["group_allow"]["opt"]["custom"])) {
$this->obj_ajax->halt_alert("x200303");
}
if (!fn_token("chk")) {
//令牌
$this->obj_ajax->halt_alert("x030102");
}
$_num_customId = fn_getSafe(fn_post("custom_id"), "int", 0);
//ID
if ($_num_customId == 0) {
$this->obj_ajax->halt_alert("x200209");
}
$_arr_customRow = $this->mdl_custom->mdl_read($_num_customId);
if ($_arr_customRow["alert"] != "y200102") {
$this->obj_ajax->halt_alert($_arr_customRow["alert"]);
}
$_num_parentId = fn_getSafe(fn_post("custom_parent_id"), "int", 0);
$_str_orderType = fn_getSafe(fn_post("order_type"), "txt", "order_first");
$_num_targetId = fn_getSafe(fn_post("order_target"), "int", 0);
$_arr_customRow = $this->mdl_custom->mdl_order($_str_orderType, $_num_customId, $_num_targetId, $_num_parentId);
$this->misc_process();
$this->obj_ajax->halt_alert($_arr_customRow["alert"]);
}
示例4: api_decode
/**
* api_decode function.
*
* @access public
* @return void
*/
function api_decode()
{
$this->app_check("post");
$_arr_code = validateStr(fn_post("code"), 1, 0);
switch ($_arr_code["status"]) {
case "too_short":
$_arr_return = array("alert" => "x080202");
$this->obj_api->halt_re($_arr_return);
break;
case "ok":
$_str_code = $_arr_code["str"];
break;
}
$_arr_key = validateStr(fn_post("key"), 1, 0);
switch ($_arr_key["status"]) {
case "too_short":
$_arr_return = array("alert" => "x080203");
$this->obj_api->halt_re($_arr_return);
break;
case "ok":
$_str_key = $_arr_key["str"];
break;
}
$_str_result = fn_baigoDecode($_str_code, $_str_key);
exit($_str_result);
}
示例5: ajax_order
/**
* ajax_order function.
*
* @access public
* @return void
*/
function ajax_order()
{
if (!isset($this->adminLogged["groupRow"]["group_allow"]["cate"]["edit"])) {
$this->obj_ajax->halt_alert("x110303");
}
if (!fn_token("chk")) {
//令牌
$this->obj_ajax->halt_alert("x030102");
}
$_num_cateId = fn_getSafe(fn_post("cate_id"), "int", 0);
//ID
if ($_num_cateId == 0) {
$this->obj_ajax->halt_alert("x110217");
}
$_arr_cateRow = $this->mdl_cate->mdl_read($_num_cateId);
if ($_arr_cateRow["alert"] != "y110102") {
$this->obj_ajax->halt_alert($_arr_cateRow["alert"]);
}
$_num_parentId = fn_getSafe(fn_post("cate_parent_id"), "int", 0);
$_str_orderType = fn_getSafe(fn_post("order_type"), "txt", "order_first");
$_num_targetId = fn_getSafe(fn_post("order_target"), "int", 0);
$_arr_cateRow = $this->mdl_cate->mdl_order($_str_orderType, $_num_cateId, $_num_targetId, $_num_parentId);
$this->mdl_cate->mdl_cache(array($_num_cateId));
$this->obj_ajax->halt_alert($_arr_cateRow["alert"]);
}
示例6: ajax_submit
/**
* ajax_submit function.
*
* @access public
* @return void
*/
function ajax_submit()
{
$_arr_adminSubmit = $this->mdl_admin->input_submit();
if ($_arr_adminSubmit["alert"] != "ok") {
$this->obj_ajax->halt_alert($_arr_adminSubmit["alert"]);
}
$_str_adminPassDo = "";
$_str_adminRand = "";
if ($_arr_adminSubmit["admin_id"] > 0) {
if (!isset($this->adminLogged["admin_allow"]["admin"]["edit"]) && !$this->is_super) {
$this->obj_ajax->halt_alert("x020303");
}
if ($_arr_adminSubmit["admin_id"] == $this->adminLogged["admin_id"] && !$this->is_super) {
$this->obj_ajax->halt_alert("x020306");
}
$_str_adminPass = fn_post("admin_pass");
if (!fn_isEmpty($_str_adminPass)) {
$_str_adminRand = fn_rand(6);
$_str_adminPassDo = fn_baigoEncrypt($_str_adminPass, $_str_adminRand);
}
} else {
if (!isset($this->adminLogged["admin_allow"]["admin"]["add"]) && !$this->is_super) {
$this->obj_ajax->halt_alert("x020302");
}
$_arr_adminPass = validateStr(fn_post("admin_pass"), 1, 0);
switch ($_arr_adminPass["status"]) {
case "too_short":
$this->obj_ajax->halt_alert("x020205");
break;
case "ok":
$_str_adminPass = $_arr_adminPass["str"];
break;
}
$_str_adminRand = fn_rand(6);
$_str_adminPassDo = fn_baigoEncrypt($_str_adminPass, $_str_adminRand);
}
$_arr_adminRow = $this->mdl_admin->mdl_submit($_str_adminPassDo, $_str_adminRand);
if ($_arr_adminRow["alert"] == "y020101" || $_arr_adminRow["alert"] == "y020103") {
$_arr_targets[] = array("admin_id" => $_arr_adminRow["admin_id"]);
$_str_targets = json_encode($_arr_targets);
if ($_arr_adminRow["alert"] == "y020101") {
$_type = "add";
} else {
$_type = "edit";
}
$_str_adminRow = json_encode($_arr_adminRow);
$_arr_logData = array("log_targets" => $_str_targets, "log_target_type" => "admin", "log_title" => $this->log["admin"][$_type], "log_result" => $_str_adminRow, "log_type" => "admin");
$this->mdl_log->mdl_submit($_arr_logData, $this->adminLogged["admin_id"]);
}
$this->obj_ajax->halt_alert($_arr_adminRow["alert"]);
}
示例7: ajax_toSpec
function ajax_toSpec()
{
if (!isset($this->adminLogged["groupRow"]["group_allow"]["article"]["spec"])) {
$this->obj_ajax->halt_alert("x180302");
}
$_arr_articleIds = $this->mdl_article->input_ids();
if ($_arr_articleIds["alert"] != "ok") {
$this->obj_ajax->halt_alert($_arr_articleIds["alert"]);
}
$_str_act = fn_getSafe($GLOBALS["act_post"], "txt", "");
$_nun_specId = fn_getSafe(fn_post("spec_id"), "int", 0);
$_arr_articleRow = $this->mdl_article->mdl_toSpec($_str_act, $_nun_specId);
$this->obj_ajax->halt_alert($_arr_articleRow["alert"]);
}
示例8: notify_input
/** 读取 app 信息
* app_get function.
*
* @access public
* @param bool $chk_token (default: false)
* @return void
*/
function notify_input($str_method = "get", $chk_token = false)
{
switch ($str_method) {
case "post":
$_str_time = fn_post("time");
$_str_signature = fn_post("signature");
$_str_code = fn_post("code");
$this->jsonp_callback = fn_post("callback");
$_arr_notifyInput["act_post"] = fn_post("act_post");
break;
default:
$_str_time = fn_get("time");
$_str_signature = fn_get("signature");
$_str_code = fn_get("code");
$this->jsonp_callback = fn_get("callback");
$_arr_notifyInput["act_get"] = fn_get("act_get");
break;
}
$_arr_time = validateStr($_str_time, 1, 0);
switch ($_arr_time["status"]) {
case "too_short":
return array("alert" => "x220201");
break;
case "ok":
$_arr_notifyInput["time"] = $_arr_time["str"];
break;
}
$_arr_signature = validateStr($_str_signature, 1, 0);
switch ($_arr_signature["status"]) {
case "too_short":
return array("alert" => "x220203");
break;
case "ok":
$_arr_notifyInput["signature"] = $_arr_signature["str"];
break;
}
$_arr_code = validateStr($_str_code, 1, 0);
switch ($_arr_code["status"]) {
case "too_short":
return array("alert" => "x220204");
break;
case "ok":
$_arr_notifyInput["code"] = $_arr_code["str"];
break;
}
$_arr_notifyInput["alert"] = "ok";
return $_arr_notifyInput;
}
示例9: ajax_submit
/**
* ajax_submit function.
*
* @access public
* @return void
*/
function ajax_submit()
{
$_arr_adminSubmit = $this->mdl_admin->input_submit();
if ($_arr_adminSubmit["alert"] != "ok") {
$this->obj_ajax->halt_alert($_arr_adminSubmit["alert"]);
}
if ($_arr_adminSubmit["admin_id"] > 0) {
if (!isset($this->adminLogged["admin_allow"]["admin"]["edit"])) {
$this->obj_ajax->halt_alert("x020303");
}
if ($_arr_adminSubmit["admin_id"] == $this->adminLogged["admin_id"]) {
$this->obj_ajax->halt_alert("x020306");
}
$_arr_ssoGet = $this->obj_sso->sso_get($_arr_adminSubmit["admin_id"]);
if ($_arr_ssoGet["alert"] != "y010102") {
$this->obj_ajax->halt_alert($_arr_ssoGet["alert"]);
}
$_str_adminPass = fn_post("admin_pass");
$_arr_ssoEdit = $this->obj_sso->sso_edit($_arr_adminSubmit["admin_name"], "", $_str_adminPass, $_arr_adminSubmit["admin_mail"], $_arr_adminSubmit["admin_nick"]);
$_num_adminId = $_arr_adminSubmit["admin_id"];
} else {
if (!isset($this->adminLogged["admin_allow"]["admin"]["add"])) {
$this->obj_ajax->halt_alert("x020302");
}
$_arr_adminPass = validateStr(fn_post("admin_pass"), 1, 0);
switch ($_arr_adminPass["status"]) {
case "too_short":
$this->obj_ajax->halt_alert("x020210");
break;
case "ok":
$_str_adminPass = $_arr_adminPass["str"];
break;
}
$_arr_ssoReg = $this->obj_sso->sso_reg($_arr_adminSubmit["admin_name"], $_str_adminPass, $_arr_adminSubmit["admin_mail"], $_arr_adminSubmit["admin_nick"]);
if ($_arr_ssoReg["alert"] != "y010101") {
$this->obj_ajax->halt_alert($_arr_ssoReg["alert"]);
}
$_num_adminId = $_arr_ssoReg["user_id"];
}
$_arr_adminRow = $this->mdl_admin->mdl_submit($_num_adminId);
if ($_arr_ssoEdit["alert"] == "y010103" || $_arr_adminRow["alert"] == "y020103") {
$_str_alert = "y020103";
} else {
$_str_alert = $_arr_adminRow["alert"];
}
$this->obj_ajax->halt_alert($_str_alert);
}
示例10: ajax_reset
function ajax_reset()
{
if (!isset($this->adminLogged["groupRow"]["group_allow"]["more"]["app"])) {
$this->obj_ajax->halt_alert("x190303");
}
$_num_appId = fn_getSafe(fn_post("app_id"), "int", 0);
if ($_num_appId == 0) {
return array("alert" => "x190203");
}
$_arr_appRow = $this->mdl_app->mdl_read($_num_appId);
if ($_arr_appRow["alert"] != "y190102") {
return $_arr_appRow;
exit;
}
$_arr_appRow = $this->mdl_app->mdl_reset($_num_appId);
$this->obj_ajax->halt_alert($_arr_appRow["alert"]);
}
示例11: fn_token
/** 令牌生成、校对
* fn_token function.
*
* @access public
* @param string $token_action (default: "mk")
* @param string $token_method (default: "post")
* @return void
*/
function fn_token($token_action = "mk")
{
if (fn_isEmpty(fn_session("admin_hash"))) {
$_str_nameSession = "token_session";
$_str_nameCookie = "token_cookie";
} else {
$_str_tokenName = fn_session("admin_hash");
$_str_nameSession = "token_session_" . $_str_tokenName;
$_str_nameCookie = "token_cookie_" . $_str_tokenName;
}
switch ($token_action) {
case "chk":
$_str_nameSession = fn_getSafe(fn_post($_str_nameSession), "txt", "");
$_str_nameCookie = fn_cookie($_str_nameCookie);
if (BG_SWITCH_TOKEN == 1) {
if ($_str_nameSession != fn_session($_str_nameSession) || $_str_nameCookie != fn_session($_str_nameCookie)) {
$_str_return = false;
} else {
$_str_return = true;
}
} else {
$_str_return = true;
}
break;
default:
if (BG_SWITCH_TOKEN == 1) {
if (fn_isEmpty(fn_session($_str_nameSession))) {
$_str_tokenSession = fn_rand();
fn_session($_str_nameSession, "mk", $_str_tokenSession);
} else {
$_str_tokenSession = fn_session($_str_nameSession);
}
if (fn_isEmpty(fn_session($_str_nameCookie))) {
$_str_tokenCookie = fn_rand();
fn_session($_str_nameCookie, "mk", $_str_tokenCookie);
} else {
$_str_tokenCookie = fn_session($_str_nameCookie);
}
$_str_return = $_str_tokenSession;
fn_cookie($_str_nameCookie, "mk", $_str_tokenCookie);
}
break;
}
return array("token" => $_str_return, "name_session" => $_str_nameSession, "name_sookie" => $_str_nameCookie);
}
示例12: app_get
/** 读取 app 信息
* app_get function.
*
* @access public
* @param bool $chk_token (default: false)
* @return void
*/
function app_get($str_method = "get", $chk_token = false)
{
if ($str_method == "post") {
$num_appId = fn_post("app_id");
$str_appKey = fn_post("app_key");
} else {
$num_appId = fn_get("app_id");
$str_appKey = fn_get("app_key");
}
$_arr_appId = validateStr($num_appId, 1, 0, "str", "int");
switch ($_arr_appId["status"]) {
case "too_short":
return array("alert" => "x050203");
exit;
break;
case "format_err":
return array("alert" => "x050204");
exit;
break;
case "ok":
$_arr_appGet["app_id"] = $_arr_appId["str"];
break;
}
$_arr_appKey = validateStr($str_appKey, 1, 64, "str", "alphabetDigit");
switch ($_arr_appKey["status"]) {
case "too_short":
return array("alert" => "x050214");
exit;
break;
case "too_long":
return array("alert" => "x050215");
exit;
break;
case "format_err":
return array("alert" => "x050216");
exit;
break;
case "ok":
$_arr_appGet["app_key"] = $_arr_appKey["str"];
break;
}
$_arr_appGet["alert"] = "ok";
return $_arr_appGet;
}
示例13: api_decode
/**
* api_decode function.
*
* @access public
* @return void
*/
function api_decode()
{
$this->app_check("post");
$_arr_code = validateStr(fn_post("code"), 1, 0);
switch ($_arr_code["status"]) {
case "too_short":
$_arr_return = array("alert" => "x050223");
$this->obj_api->halt_re($_arr_return);
break;
case "ok":
$_str_code = $_arr_code["str"];
break;
}
$_arr_sign = array("act_post" => $GLOBALS["act_post"], "code" => $_str_code);
if (!$this->obj_sign->sign_check(array_merge($this->appRequest, $_arr_sign), $this->appRequest["signature"])) {
$_arr_return = array("alert" => "x050403");
$this->obj_api->halt_re($_arr_return);
}
$_str_result = $this->obj_crypt->decrypt($_str_code, $this->appRow["app_key"]);
exit($_str_result);
}
示例14: ajax_visit
/**
* ajax_visit function.
*
* @access public
* @return void
*/
function ajax_visit()
{
if (!isset($this->adminLogged["groupRow"]["group_allow"]["opt"]["visit"])) {
$this->obj_ajax->halt_alert("x060304");
}
$_arr_return = $this->mdl_opt->mdl_const("visit");
if ($_arr_return["alert"] != "y060101") {
$this->obj_ajax->halt_alert($_arr_return["alert"]);
}
$_arr_post = fn_post("opt");
if ($_arr_post["BG_VISIT_TYPE"] == "pstatic") {
$_arr_return = $this->mdl_opt->mdl_htaccess();
if ($_arr_return["alert"] != "y060101") {
$this->obj_ajax->halt_alert($_arr_return["alert"]);
}
} else {
if (file_exists(BG_PATH_ROOT . ".htaccess")) {
unlink(BG_PATH_ROOT . ".htaccess");
}
}
$this->obj_ajax->halt_alert("y060404");
}
示例15: api_verify
/**
* api_verify function.
*
* @access public
* @return void
*/
function api_verify()
{
$this->app_check("post");
$_arr_params = fn_post("params");
$_arr_signature = validateStr(fn_post("signature"), 1, 0);
switch ($_arr_signature["status"]) {
case "too_short":
$_arr_return = array("alert" => "x050226");
$this->obj_api->halt_re($_arr_return);
break;
case "ok":
$_str_sign = $_arr_signature["str"];
break;
}
if ($this->obj_sign->sign_check($_arr_params, $_str_sign)) {
$_str_alert = "y050403";
} else {
$_str_alert = "x050403";
}
$_arr_return = array("alert" => $_str_alert);
$this->obj_api->halt_re($_arr_return);
}