当前位置: 首页>>代码示例>>PHP>>正文


PHP get_request_var_post函数代码示例

本文整理汇总了PHP中get_request_var_post函数的典型用法代码示例。如果您正苦于以下问题:PHP get_request_var_post函数的具体用法?PHP get_request_var_post怎么用?PHP get_request_var_post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_request_var_post函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: form_save

function form_save() {

	if (isset($_POST["save_component_import"])) {
		if (trim($_POST["import_text"] != "")) {
			/* textbox input */
			$xml_data = $_POST["import_text"];
		}elseif (($_FILES["import_file"]["tmp_name"] != "none") && ($_FILES["import_file"]["tmp_name"] != "")) {
			/* file upload */
			$fp = fopen($_FILES["import_file"]["tmp_name"],"r");
			$xml_data = fread($fp,filesize($_FILES["import_file"]["tmp_name"]));
			fclose($fp);
		}else{
			header("Location: templates_import.php"); exit;
		}

		if (get_request_var_post("import_rra") == "1") {
			$import_custom_rra_settings = false;
		}else{
			$import_custom_rra_settings = true;
		}

		/* obtain debug information if it's set */
		$debug_data = import_xml_data($xml_data, $import_custom_rra_settings);
		if(sizeof($debug_data) > 0) {
			$_SESSION["import_debug_info"] = $debug_data;
		}

		header("Location: templates_import.php");
		exit;
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:31,代码来源:templates_import.php

示例2: form_save

function form_save()
{
    /* modify for multi user start */
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post("id"));
    /* ==================================================== */
    if (!check_notification($_REQUEST['id'])) {
        access_denied();
    }
    /* modify for multi user end */
    if (isset($_POST["save_component"])) {
        $save["id"] = $_POST["id"];
        $save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
        $save["description"] = form_input_validate($_POST["description"], "description", "", false, 3);
        $save["emails"] = form_input_validate($_POST["emails"], "emails", "", false, 3);
        if (!is_error_message()) {
            $id = sql_save($save, "plugin_notification_lists");
            if ($id) {
                raise_message(1);
            } else {
                raise_message(2);
            }
        }
    }
    header("Location: notify_lists.php?action=edit&id=" . (empty($id) ? $_POST["id"] : $id));
}
开发者ID:resmon,项目名称:resmon-cacti,代码行数:26,代码来源:notify_lists.php

示例3: form_save

function form_save()
{
    global $export_types, $export_errors;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post('export_item_id'));
    /* ==================================================== */
    if (isset($_POST['save_component_export'])) {
        $export_errors = 0;
        $xml_data = get_item_xml($_POST['export_type'], $_POST['export_item_id'], (isset($_POST['include_deps']) ? $_POST['include_deps'] : '') == '' ? false : true);
        if ($_POST['output_format'] == '1') {
            top_header();
            print "<table width='100%' align='center'><tr><td><pre>" . htmlspecialchars($xml_data) . '</pre></td></tr></table>';
            bottom_footer();
        } elseif ($_POST['output_format'] == '2') {
            header('Content-type: application/xml');
            if ($export_errors) {
                echo "WARNING: Export Errors Encountered.  Refresh Browser Window for Details!\n";
            }
            print $xml_data;
        } elseif ($_POST['output_format'] == '3') {
            if ($export_errors) {
                header('Location: templates_export.php');
            } else {
                header('Content-type: application/xml');
                header('Content-Disposition: attachment; filename=cacti_' . $_POST['export_type'] . '_' . strtolower(clean_up_file_name(db_fetch_cell(str_replace('|id|', $_POST['export_item_id'], $export_types[$_POST['export_type']]['title_sql'])))) . '.xml');
                print $xml_data;
            }
        }
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:30,代码来源:templates_export.php

示例4: form_save

function form_save()
{
    global $export_types, $export_errors;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post("export_item_id"));
    /* ==================================================== */
    if (isset($_POST["save_component_export"])) {
        $export_errors = 0;
        $xml_data = get_item_xml($_POST["export_type"], $_POST["export_item_id"], (isset($_POST["include_deps"]) ? $_POST["include_deps"] : "") == "" ? false : true);
        if ($_POST["output_format"] == "1") {
            include_once "./include/top_header.php";
            print "<table width='100%' align='center'><tr><td><pre>" . htmlspecialchars($xml_data) . "</pre></td></tr></table>";
            include_once "./include/bottom_footer.php";
        } elseif ($_POST["output_format"] == "2") {
            header("Content-type: application/xml");
            if ($export_errors) {
                echo "WARNING: Export Errors Encountered.  Refresh Browser Window for Details!\n";
            }
            print $xml_data;
        } elseif ($_POST["output_format"] == "3") {
            if ($export_errors) {
                header("Location: templates_export.php");
            } else {
                header("Content-type: application/xml");
                header("Content-Disposition: attachment; filename=cacti_" . $_POST["export_type"] . "_" . strtolower(clean_up_file_name(db_fetch_cell(str_replace("|id|", $_POST["export_item_id"], $export_types[$_POST["export_type"]]["title_sql"])))) . ".xml");
                print $xml_data;
            }
        }
    }
}
开发者ID:teddywen,项目名称:cacti,代码行数:30,代码来源:templates_export.php

示例5: form_save

function form_save()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post("host_template_id"));
    input_validate_input_number(get_request_var_post("snmp_query_id"));
    input_validate_input_number(get_request_var_post("graph_template_id"));
    /* ==================================================== */
    if (isset($_POST["save_component_template"])) {
        $redirect_back = false;
        $save["id"] = $_POST["id"];
        $save["hash"] = get_hash_host_template($_POST["id"]);
        $save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
        if (!is_error_message()) {
            $host_template_id = sql_save($save, "host_template");
            if ($host_template_id) {
                raise_message(1);
                if (isset($_POST["add_gt_x"])) {
                    db_execute("replace into host_template_graph (host_template_id,graph_template_id) values({$host_template_id}," . $_POST["graph_template_id"] . ")");
                    $redirect_back = true;
                } elseif (isset($_POST["add_dq_x"])) {
                    db_execute("replace into host_template_snmp_query (host_template_id,snmp_query_id) values({$host_template_id}," . $_POST["snmp_query_id"] . ")");
                    $redirect_back = true;
                }
            } else {
                raise_message(2);
            }
        }
        header("Location: host_templates.php?action=edit&id=" . (empty($host_template_id) ? $_POST["id"] : $host_template_id));
    }
}
开发者ID:resmon,项目名称:resmon-cacti,代码行数:30,代码来源:host_templates.php

示例6: form_save

function form_save()
{
    if (isset($_POST["save_component_gprint_presets"])) {
        /* ================= input validation ================= */
        input_validate_input_number(get_request_var_post("id"));
        /* ==================================================== */
        $save["id"] = $_POST["id"];
        $save["hash"] = get_hash_gprint($_POST["id"]);
        $save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
        $save["gprint_text"] = form_input_validate($_POST["gprint_text"], "gprint_text", "", false, 3);
        if (!is_error_message()) {
            $gprint_preset_id = sql_save($save, "graph_templates_gprint");
            if ($gprint_preset_id) {
                raise_message(1);
            } else {
                raise_message(2);
            }
        }
        if (is_error_message()) {
            header("Location: gprint_presets.php?action=edit&id=" . (empty($gprint_preset_id) ? $_POST["id"] : $gprint_preset_id));
            exit;
        } else {
            header("Location: gprint_presets.php");
            exit;
        }
    }
}
开发者ID:teddywen,项目名称:cacti,代码行数:27,代码来源:gprint_presets.php

示例7: form_save

function form_save()
{
    global $settings_graphs, $cnn_id;
    while (list($tab_short_name, $tab_fields) = each($settings_graphs)) {
        while (list($field_name, $field_array) = each($tab_fields)) {
            /* Check every field with a numeric default value and reset it to default if the inputted value is not numeric  */
            if (isset($field_array["default"]) && is_numeric($field_array["default"]) && !is_numeric(get_request_var_post($field_name))) {
                $_POST[$field_name] = $field_array["default"];
            }
            if ($field_array["method"] == "checkbox") {
                if (isset($_POST[$field_name])) {
                    db_execute("REPLACE INTO settings_graphs (user_id,name,value) VALUES (" . $_SESSION["sess_user_id"] . ",'{$field_name}', 'on')");
                } else {
                    db_execute("REPLACE INTO settings_graphs (user_id,name,value) VALUES (" . $_SESSION["sess_user_id"] . ",'{$field_name}', '')");
                }
            } elseif ($field_array["method"] == "checkbox_group") {
                while (list($sub_field_name, $sub_field_array) = each($field_array["items"])) {
                    if (isset($_POST[$sub_field_name])) {
                        db_execute("REPLACE INTO settings_graphs (user_id,name,value) VALUES (" . $_SESSION["sess_user_id"] . ",'{$sub_field_name}', 'on')");
                    } else {
                        db_execute("REPLACE INTO settings_graphs (user_id,name,value) VALUES (" . $_SESSION["sess_user_id"] . ",'{$sub_field_name}', '')");
                    }
                }
            } elseif ($field_array["method"] == "textbox_password") {
                if ($_POST[$field_name] != $_POST[$field_name . "_confirm"]) {
                    raise_message(4);
                    break;
                } elseif (isset($_POST[$field_name])) {
                    $value = $cnn_id->qstr(get_request_var_post($field_name));
                    db_execute("REPLACE INTO settings_graphs (user_id,name,value) VALUES (" . $_SESSION["sess_user_id"] . ",'{$field_name}', {$value})");
                }
            } elseif (isset($field_array["items"]) && is_array($field_array["items"])) {
                while (list($sub_field_name, $sub_field_array) = each($field_array["items"])) {
                    if (isset($_POST[$sub_field_name])) {
                        $value = $cnn_id->qstr(get_request_var_post($sub_field_name));
                        db_execute("REPLACE INTO settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'{$sub_field_name}', " . $value . ")");
                    }
                }
            } else {
                if (isset($_POST[$field_name])) {
                    $value = $cnn_id->qstr($_POST[$field_name]);
                    db_execute("REPLACE INTO settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'{$field_name}', " . $value . ")");
                }
            }
        }
    }
    /* reset local settings cache so the user sees the new settings */
    kill_session_var("sess_graph_config_array");
    header("Location: " . $_SESSION["graph_settings_referer"]);
}
开发者ID:teddywen,项目名称:cacti,代码行数:50,代码来源:graph_settings.php

示例8: data_template_item_save

/**
 * data_template_item_save	- save data to table data_template_rrd
 */
function data_template_item_save() {
	require_once(CACTI_BASE_PATH . "/include/data_source/data_source_constants.php");

	if (isset($_POST["save_component_item"])) {
		/* ================= input validation ================= */
		input_validate_input_number(get_request_var_post("data_template_id"));
		/* ==================================================== */

		/* save: data_template_rrd */
		$save["id"] = $_POST["data_template_rrd_id"];
		$save["hash"] = get_hash_data_template($_POST["data_template_rrd_id"], "data_template_item");
		$save["local_data_template_rrd_id"] = 0;
		$save["local_data_id"] = 0;
		$save["data_template_id"] = $_POST["data_template_id"];

		$save["t_rrd_maximum"] = form_input_validate((isset($_POST["t_rrd_maximum"]) ? $_POST["t_rrd_maximum"] : ""), "t_rrd_maximum", "", true, 3);
		$save["rrd_maximum"] = form_input_validate($_POST["rrd_maximum"], "rrd_maximum", "^(-?([0-9]+(\.[0-9]*)?|[0-9]*\.[0-9]+)([eE][+\-]?[0-9]+)?)|U$", (isset($_POST["t_rrd_maximum"]) ? true : false), 3);
		$save["t_rrd_minimum"] = form_input_validate((isset($_POST["t_rrd_minimum"]) ? $_POST["t_rrd_minimum"] : ""), "t_rrd_minimum", "", true, 3);
		$save["rrd_minimum"] = form_input_validate($_POST["rrd_minimum"], "rrd_minimum", "^(-?([0-9]+(\.[0-9]*)?|[0-9]*\.[0-9]+)([eE][+\-]?[0-9]+)?)|U$", (isset($_POST["t_rrd_minimum"]) ? true : false), 3);
		$save["t_rrd_compute_rpn"] = form_input_validate((isset($_POST["t_rrd_compute_rpn"]) ? $_POST["t_rrd_compute_rpn"] : ""), "t_rrd_compute_rpn", "", true, 3);
		/* rrd_compute_rpn requires input only for COMPUTE data source type */
		$save["rrd_compute_rpn"] = form_input_validate($_POST["rrd_compute_rpn"], "rrd_compute_rpn", "", ((isset($_POST["t_rrd_compute_rpn"]) || ($_POST["data_source_type_id"] != DATA_SOURCE_TYPE_COMPUTE)) ? true : false), 3);
		$save["t_rrd_heartbeat"] = form_input_validate((isset($_POST["t_rrd_heartbeat"]) ? $_POST["t_rrd_heartbeat"] : ""), "t_rrd_heartbeat", "", true, 3);
		$save["rrd_heartbeat"] = form_input_validate($_POST["rrd_heartbeat"], "rrd_heartbeat", "^[0-9]+$", (isset($_POST["t_rrd_heartbeat"]) ? true : false), 3);
		$save["t_data_source_type_id"] = form_input_validate((isset($_POST["t_data_source_type_id"]) ? $_POST["t_data_source_type_id"] : ""), "t_data_source_type_id", "", true, 3);
		$save["data_source_type_id"] = form_input_validate($_POST["data_source_type_id"], "data_source_type_id", "", true, 3);
		$save["t_data_source_name"] = form_input_validate((isset($_POST["t_data_source_name"]) ? $_POST["t_data_source_name"] : ""), "t_data_source_name", "", true, 3);
		$save["data_source_name"] = form_input_validate($_POST["data_source_name"], "data_source_name", "^[a-zA-Z0-9_]{1,19}$", (isset($_POST["t_data_source_name"]) ? true : false), 3);
		$save["t_data_input_field_id"] = form_input_validate((isset($_POST["t_data_input_field_id"]) ? $_POST["t_data_input_field_id"] : ""), "t_data_input_field_id", "", true, 3);
		$save["data_input_field_id"] = form_input_validate((isset($_POST["data_input_field_id"]) ? $_POST["data_input_field_id"] : "0"), "data_input_field_id", "", true, 3);

		if (!is_error_message()) {

			$data_template_rrd_id = sql_save($save, "data_template_rrd");

			if ($data_template_rrd_id) {
				raise_message(1);
				push_out_data_source_item($data_template_rrd_id);
			}else{
				raise_message(2);
			}
		}

		if (is_error_message()) {
			header("Location: data_templates_items.php?action=item_edit&item_id=" . (empty($data_template_rrd_id) ? $_POST["data_template_rrd_id"] : $data_template_rrd_id) . "&id=" . $_POST["data_template_id"]);
		}else{
			header("Location: data_templates.php?action=template_edit&id=" . $_POST["data_template_id"]);
		}
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:53,代码来源:data_templates_items.php

示例9: form_save

function form_save()
{
    global $settings_graphs;
    while (list($tab_short_name, $tab_fields) = each($settings_graphs)) {
        while (list($field_name, $field_array) = each($tab_fields)) {
            /* Check every field with a numeric default value and reset it to default if the inputted value is not numeric  */
            if (isset($field_array['default']) && is_numeric($field_array['default']) && !is_numeric(get_request_var_post($field_name))) {
                $_POST[$field_name] = $field_array['default'];
            }
            if ($field_array['method'] == 'checkbox') {
                if (isset($_POST[$field_name])) {
                    db_execute_prepared("REPLACE INTO settings_graphs (user_id,name,value) VALUES (?, ?, 'on')", array($_SESSION['sess_user_id'], $field_name));
                } else {
                    db_execute_prepared("REPLACE INTO settings_graphs (user_id,name,value) VALUES (?, ?, '')", array($_SESSION['sess_user_id'], $field_name));
                }
            } elseif ($field_array['method'] == 'checkbox_group') {
                while (list($sub_field_name, $sub_field_array) = each($field_array['items'])) {
                    if (isset($_POST[$sub_field_name])) {
                        db_execute_prepared("REPLACE INTO settings_graphs (user_id,name,value) VALUES (?, ?, 'on')", array($_SESSION['sess_user_id'], $sub_field_name));
                    } else {
                        db_execute_prepared("REPLACE INTO settings_graphs (user_id,name,value) VALUES (?, ?, '')", array($_SESSION['sess_user_id'], $sub_field_name));
                    }
                }
            } elseif ($field_array['method'] == 'textbox_password') {
                if ($_POST[$field_name] != $_POST[$field_name . '_confirm']) {
                    raise_message(4);
                    break;
                } elseif (isset($_POST[$field_name])) {
                    db_execute_prepared('REPLACE INTO settings_graphs (user_id, name, value) VALUES (?, ?, ?)', array($_SESSION['sess_user_id'], $field_name, get_request_var_post($field_name)));
                }
            } elseif (isset($field_array['items']) && is_array($field_array['items'])) {
                while (list($sub_field_name, $sub_field_array) = each($field_array['items'])) {
                    if (isset($_POST[$sub_field_name])) {
                        db_execute_prepared('REPLACE INTO settings_graphs (user_id, name, value) values (?, ?, ?)', array($_SESSION['sess_user_id'], $sub_field_name, get_request_var_post($sub_field_name)));
                    }
                }
            } else {
                if (isset($_POST[$field_name])) {
                    db_execute_prepared('REPLACE INTO settings_graphs (user_id, name, value) values (?, ?, ?)', array($_SESSION['sess_user_id'], $field_name, get_request_var_post($field_name)));
                }
            }
        }
    }
    raise_message(1);
    /* reset local settings cache so the user sees the new settings */
    kill_session_var('sess_graph_config_array');
}
开发者ID:MrWnn,项目名称:cacti,代码行数:47,代码来源:graph_settings.php

示例10: form_actions

function form_actions()
{
    global $gprint_actions;
    /* ================= input validation ================= */
    input_validate_input_regex(get_request_var_post('drp_action'), '^([a-zA-Z0-9_]+)$');
    /* ==================================================== */
    /* if we are to save this form, instead of display it */
    if (isset($_POST['selected_items'])) {
        $selected_items = unserialize(stripslashes($_POST['selected_items']));
        if ($_POST['drp_action'] == '1') {
            /* delete */
            db_execute('DELETE FROM graph_templates_gprint WHERE ' . array_to_sql_or($selected_items, 'id'));
        }
        header('Location: gprint_presets.php');
        exit;
    }
    /* setup some variables */
    $gprint_list = '';
    $i = 0;
    /* loop through each of the graphs selected on the previous page and get more info about them */
    while (list($var, $val) = each($_POST)) {
        if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) {
            /* ================= input validation ================= */
            input_validate_input_number($matches[1]);
            /* ==================================================== */
            $gprint_list .= '<li>' . htmlspecialchars(db_fetch_cell_prepared('SELECT name FROM graph_templates_gprint WHERE id = ?', array($matches[1]))) . '</li>';
            $gprint_array[$i] = $matches[1];
            $i++;
        }
    }
    top_header();
    print "<form action='gprint_presets.php' method='post'>\n";
    html_start_box('<strong>' . $gprint_actions[$_POST['drp_action']] . '</strong>', '60%', '', '3', 'center', '');
    if (isset($gprint_array) && sizeof($gprint_array)) {
        if ($_POST['drp_action'] == '1') {
            /* delete */
            print "\t<tr>\n\t\t\t\t\t<td class='textArea' class='odd'>\n\t\t\t\t\t\t<p>When you click \"Continue\", the folling GPRINT Preset(s) will be deleted.</p>\n\t\t\t\t\t\t<ul>{$gprint_list}</ul>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
            $save_html = "<input type='button' value='Cancel' onClick='window.history.back()'>&nbsp;<input type='submit' value='Continue' title='Delete GPRINT Preset(s)'>";
        }
    } else {
        print "<tr><td class='odd'><span class='textError'>You must select at least one GPRINT Preset.</span></td></tr>\n";
        $save_html = "<input type='button' value='Return' onClick='window.history.back()'>";
    }
    print "\t<tr>\n\t\t\t<td align='right' class='saveRow'>\n\t\t\t\t<input type='hidden' name='action' value='actions'>\n\t\t\t\t<input type='hidden' name='selected_items' value='" . (isset($gprint_array) ? serialize($gprint_array) : '') . "'>\n\t\t\t\t<input type='hidden' name='drp_action' value='" . $_POST['drp_action'] . "'>\n\t\t\t\t{$save_html}\n\t\t\t</td>\n\t\t</tr>\n";
    html_end_box();
    bottom_footer();
}
开发者ID:MrWnn,项目名称:cacti,代码行数:47,代码来源:gprint_presets.php

示例11: form_save

function form_save() {
	global $export_types;

	if (isset($_POST["save_component_export"])) {
		$xml_data = get_item_xml($_POST["export_type"], $_POST["export_item_id"], (((isset($_POST["include_deps"]) ? $_POST["include_deps"] : "") == "") ? false : true));

		if (get_request_var_post("output_format") == "1") {
			include_once(CACTI_BASE_PATH . "/include/top_header.php");
			print "<table class='wp100 center'><tr><td><pre>" . htmlspecialchars($xml_data) . "</pre></td></tr></table>";
			include_once(CACTI_BASE_PATH . "/include/bottom_footer.php");
		}elseif (get_request_var_post("output_format") == "2") {
			header("Content-type: application/xml");
			print $xml_data;
		}elseif (get_request_var_post("output_format") == "3") {
			header("Content-type: application/xml");
			header("Content-Disposition: attachment; filename=cacti_" . $_POST["export_type"] . "_" . strtolower(clean_up_file_name(db_fetch_cell(str_replace("|id|", $_POST["export_item_id"], $export_types{$_POST["export_type"]}["title_sql"])))) . ".xml");
			print $xml_data;
		}
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:20,代码来源:templates_export.php

示例12: form_save

function form_save() {
	global $settings_graphs;

	while (list($tab_short_name, $tab_fields) = each($settings_graphs)) {
		while (list($field_name, $field_array) = each($tab_fields)) {
			if ((isset($field_array["items"])) && (is_array($field_array["items"]))) {
				while (list($sub_field_name, $sub_field_array) = each($field_array["items"])) {
					db_execute("replace into settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'$sub_field_name', '" . (isset($_POST[$sub_field_name]) ? $_POST[$sub_field_name] : "") . "')");
				}
			}else{
				db_execute("replace into settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'$field_name', '" . (isset($_POST[$field_name]) ? $_POST[$field_name] : "") . "')");
			}
		}
	}

	/* reset local settings cache so the user sees the new settings */
	kill_session_var("sess_graph_config_array");

	header("Location: " . get_request_var_post("referer"));
	exit;
}
开发者ID:songchin,项目名称:Cacti,代码行数:21,代码来源:graph_settings.php

示例13: form_save

function form_save()
{
    if (isset($_POST["save_component_rra"])) {
        /* ================= input validation ================= */
        input_validate_input_number(get_request_var_post("id"));
        /* ==================================================== */
        $save["id"] = $_POST["id"];
        $save["hash"] = get_hash_round_robin_archive($_POST["id"]);
        $save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
        $dummy = form_input_validate(count($_POST["consolidation_function_id"]), "consolidation_function_id", "^[0-9]*\$", false, 3);
        $save["x_files_factor"] = form_input_validate($_POST["x_files_factor"], "x_files_factor", "^[01]?(\\.[0-9]+)?\$", false, 3);
        $save["steps"] = form_input_validate($_POST["steps"], "steps", "^[0-9]*\$", false, 3);
        $save["rows"] = form_input_validate($_POST["rows"], "rows", "^[0-9]*\$", false, 3);
        $save["timespan"] = form_input_validate($_POST["timespan"], "timespan", "^[0-9]*\$", false, 3);
        if (!is_error_message()) {
            $rra_id = sql_save($save, "rra");
            if ($rra_id) {
                raise_message(1);
                db_execute("delete from rra_cf where rra_id={$rra_id}");
                if (isset($_POST["consolidation_function_id"])) {
                    for ($i = 0; $i < count($_POST["consolidation_function_id"]); $i++) {
                        /* ================= input validation ================= */
                        input_validate_input_number($_POST["consolidation_function_id"][$i]);
                        /* ==================================================== */
                        db_execute("insert into rra_cf (rra_id,consolidation_function_id)\n\t\t\t\t\t\t\tvalues ({$rra_id}," . $_POST["consolidation_function_id"][$i] . ")");
                    }
                } else {
                    raise_message(2);
                }
            } else {
                raise_message(2);
            }
        }
        if (is_error_message()) {
            header("Location: rra.php?action=edit&id=" . (empty($rra_id) ? $_POST["id"] : $rra_id));
        } else {
            header("Location: rra.php");
        }
    }
}
开发者ID:teddywen,项目名称:cacti,代码行数:40,代码来源:rra.php

示例14: form_save

function form_save()
{
    if (isset($_POST["save_component_color"])) {
        /* ================= input validation ================= */
        input_validate_input_number(get_request_var_post('id'));
        /* ==================================================== */
        $save["id"] = $_POST["id"];
        $save["hex"] = form_input_validate($_POST["hex"], "hex", "^[a-fA-F0-9]+\$", false, 3);
        if (!is_error_message()) {
            $color_id = sql_save($save, "colors");
            if ($color_id) {
                raise_message(1);
            } else {
                raise_message(2);
            }
        }
        if (is_error_message()) {
            header("Location: color.php?action=edit&id=" . (empty($color_id) ? $_POST["id"] : $color_id));
        } else {
            header("Location: color.php");
        }
    }
}
开发者ID:teddywen,项目名称:cacti,代码行数:23,代码来源:color.php

示例15: form_save

function form_save()
{
    global $settings_graphs, $cnn_id;
    while (list($tab_short_name, $tab_fields) = each($settings_graphs)) {
        while (list($field_name, $field_array) = each($tab_fields)) {
            if (isset($field_array["items"]) && is_array($field_array["items"])) {
                while (list($sub_field_name, $sub_field_array) = each($field_array["items"])) {
                    if (isset($_POST[$sub_field_name])) {
                        $value = $cnn_id->qstr(get_request_var_post($sub_field_name));
                        db_execute("REPLACE INTO settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'{$sub_field_name}', " . $value . ")");
                    }
                }
            } else {
                if (isset($_POST[$field_name])) {
                    $value = $cnn_id->qstr($_POST[$field_name]);
                    db_execute("REPLACE INTO settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'{$field_name}', " . $value . ")");
                }
            }
        }
    }
    /* reset local settings cache so the user sees the new settings */
    kill_session_var("sess_graph_config_array");
    header("Location: " . $_SESSION["graph_settings_referer"]);
}
开发者ID:resmon,项目名称:resmon-cacti,代码行数:24,代码来源:graph_settings.php


注:本文中的get_request_var_post函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。