本文整理匯總了PHP中validate_form_fields函數的典型用法代碼示例。如果您正苦於以下問題:PHP validate_form_fields函數的具體用法?PHP validate_form_fields怎麽用?PHP validate_form_fields使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了validate_form_fields函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: POST
$qualify = POST('qualify') ? 1 : 0;
$resend_events = POST('resend_events') ? 1 : 0;
$resend_alarms = POST('resend_alarms') ? 1 : 0;
$sign = POST('sign') ? 1 : 0;
$multi = POST('multi') ? 1 : 0;
$sem = POST('sem') ? 1 : 0;
$sim = POST('sim') ? 1 : 0;
$alarm_to_syslog = POST('alarm_to_syslog') ? 1 : 0;
$remoteadmin = POST('remoteadmin');
$remotepass = POST('remotepass');
$remoteurl = POST('remoteurl');
$setssh = POST('setssh') ? 1 : 0;
$rservers = POST('rservers');
$rservers = $_POST['rservers'];
unset($_POST['rservers']);
$validation_errors = validate_form_fields('POST', $validate);
$fwrd_server = array();
if (is_array($rservers) && !empty($rservers)) {
foreach ($rservers as $rserver) {
$rserver = explode('@', $rserver);
$fwr_ser = $rserver[0];
$fwr_prio = $rserver[1];
ossim_valid($fwr_ser, OSS_HEX, 'illegal:' . _("Forward Servers"));
ossim_valid($fwr_prio, OSS_DIGIT, 'illegal:' . _("Forward Priority"));
if (ossim_error()) {
$validation_errors['rservers[]'] = ossim_get_error_clean();
ossim_clean_error();
} else {
$fwrd_server[$fwr_ser] = $fwr_prio;
}
}
示例2: delete_note
function delete_note($conn)
{
$validate = array('note_id' => array('validation' => 'OSS_DIGIT', 'e_message' => 'illegal:' . _('Note ID')));
$validation_errors = validate_form_fields('POST', $validate);
if (is_array($validation_errors) && !empty($validation_errors)) {
Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Note could not be deleted'));
}
$note_id = POST('note_id');
$result = Notes::delete($conn, $note_id);
if ($result == TRUE) {
$data['msg'] = _('Note deleted successfully');
} else {
Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Note could not be deleted'));
}
return $data;
}