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


PHP input_errors2Ajax函数代码示例

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


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

示例1: unset

    /* hash */
    unset($error_bucket);
    /* simple error list */
    unset($input_errors);
    unset($do_action);
    $reqdfields = explode(" ", "action object");
    $reqdfieldsn = explode(",", "Action,Object");
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
    if (is_array($error_bucket)) {
        foreach ($error_bucket as $elem) {
            $input_errors[] =& $elem["error"];
        }
    }
    /* if this is an AJAX caller then handle via JSON */
    if (isAjax() && is_array($error_bucket)) {
        input_errors2Ajax(NULL, $error_bucket);
        exit;
    }
    if (!$input_errors) {
        $do_action = true;
        $action = $_POST['action'];
        $object = $_POST['object'];
    }
}
if (!isset($do_action)) {
    $do_action = false;
    $action = '';
    $object = '';
}
include "head.inc";
/* put your custom HTML head content here        */
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:31,代码来源:disks_raid_graid5_tools.php

示例2: gen_subnet

     }
     if (!$input_errors) {
         $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']);
         $subnet_start = ip2ulong($_POST['remoteip']);
         $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1;
         if (ip2ulong($_POST['localip']) >= $subnet_start && ip2ulong($_POST['localip']) <= $subnet_end) {
             $input_errors[] = gettext("The specified server address lies in the remote subnet.");
         }
         if ($_POST['localip'] == get_interface_ip("lan")) {
             $input_errors[] = gettext("The specified server address is equal to the LAN interface address.");
         }
     }
 }
 /* if this is an AJAX caller then handle via JSON */
 if (isAjax() && is_array($input_errors)) {
     input_errors2Ajax($input_errors);
     exit;
 }
 if (!$input_errors) {
     $l2tpcfg['remoteip'] = $_POST['remoteip'];
     $l2tpcfg['localip'] = $_POST['localip'];
     $l2tpcfg['l2tp_subnet'] = $_POST['l2tp_subnet'];
     $l2tpcfg['mode'] = $_POST['mode'];
     $l2tpcfg['interface'] = $_POST['interface'];
     $l2tpcfg['n_l2tp_units'] = $_POST['n_l2tp_units'];
     $l2tpcfg['radius']['server'] = $_POST['radiusserver'];
     if ($_POST['radiussecret'] != DMYPWD) {
         $l2tpcfg['radius']['secret'] = $_POST['radiussecret'];
     }
     if ($_POST['secret'] != DMYPWD) {
         $l2tpcfg['secret'] = $_POST['secret'];
开发者ID:z0x010,项目名称:pfsense,代码行数:31,代码来源:vpn_l2tp.php


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