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


PHP DataValidator::validate_not_empty_string方法代码示例

本文整理汇总了PHP中DataValidator::validate_not_empty_string方法的典型用法代码示例。如果您正苦于以下问题:PHP DataValidator::validate_not_empty_string方法的具体用法?PHP DataValidator::validate_not_empty_string怎么用?PHP DataValidator::validate_not_empty_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataValidator的用法示例。


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

示例1: array

if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    /*
     * Handle data from $_POST:
     * 1. validate user submitted data
     * 2. if there are errors, display the add user form updated with error messages
     * 3. if there aren't errors, add this user to the common database and to
     *    the tester databases associated with this user.
     */
    /*
     * Validazione dati
     */
    $errorsAr = array();
    if (DataValidator::validate_not_empty_string($_POST['service_name']) === FALSE) {
        $errorsAr['service_name'] = true;
    }
    if (DataValidator::validate_not_empty_string($_POST['service_description']) === FALSE) {
        $errorsAr['service_description'] = true;
    }
    if (DataValidator::is_uinteger($_POST['service_level']) === FALSE) {
        $errorsAr['service_level'] = true;
    }
    if (DataValidator::is_uinteger($_POST['service_duration']) === FALSE) {
        $errorsAr['service_duration'] = true;
    }
    if (DataValidator::is_uinteger($_POST['service_min_meetings']) === FALSE) {
        $errorsAr['service_min_meetings'] = true;
    }
    if (DataValidator::is_uinteger($_POST['service_max_meetings']) === FALSE) {
        $errorsAr['service_max_meetings'] = true;
    }
    if (DataValidator::is_uinteger($_POST['service_meeting_duration']) === FALSE) {
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:edit_service.php

示例2: array

//$rubrica_ok = 0; // Address book not loaded yet
// Has the form been posted?
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (isset($spedisci)) {
        $mh = MessageHandler::instance(MultiPort::getDSN($sess_selected_tester));
        // Initialize errors array
        $errors = array();
        // Trim all submitted data
        $form = $_POST;
        while (list($key, $value) = each($form)) {
            ${$key} = $value;
        }
        if (!isset($destinatari) || DataValidator::validate_not_empty_string($destinatari) === FALSE) {
            $errors['destinatari'] = ADA_EVENT_PROPOSAL_ERROR_RECIPIENT;
        }
        if (!isset($titolo) || DataValidator::validate_not_empty_string($titolo) === FALSE) {
            $errors['titolo'] = ADA_EVENT_PROPOSAL_ERROR_SUBJECT;
        }
        if (($value = ADAEventProposal::canProposeThisDateTime($userObj, $data_evento, $ora_evento, $sess_selected_tester)) !== TRUE) {
            $errors['$data_evento'] = $value;
        }
        // Check submitted subject
        /*      if (!is_clean_text($titolo, 0, 128)){
                $errors["titolo"] = translateFN("L'oggetto dell'appuntamento contiene caratteri non validi");
                $titolo = clean_text($titolo, 0, 128);
              }
              else {
                $ora_evento_a = tm2tsFN($ora_evento);
                $ora_evento_b = ts2tmFN($ora_evento_a);
                $data_ora = sumDateTimeFN(array($data_evento,$ora_evento));
        
开发者ID:eguicciardi,项目名称:ada,代码行数:30,代码来源:send_event.php

示例3: print_r

 *
     $navigationHistoryObj = $_SESSION['sess_navigation_history'];
     $lastModule = $navigationHistoryObj->lastModule();
     print_r($form);
 * 
 */
 /**
  * Perform login
  */
 if (isset($p_login) || isset($selectedLoginProvider) && strlen($selectedLoginProvider) > 0) {
     if (isset($p_login)) {
         $username = DataValidator::validate_username($p_username);
         $password = DataValidator::validate_password($p_password, $p_password);
     } else {
         $username = DataValidator::validate_not_empty_string($p_username);
         $password = DataValidator::validate_not_empty_string($p_password);
     }
     if (!isset($p_remindme)) {
         $p_remindme = false;
     }
     if (isset($p_login)) {
         if ($username !== FALSE && $password !== FALSE) {
             //User has correctly inserted un & pw
             $userObj = MultiPort::loginUser($username, $password);
             $loginObj = null;
         } else {
             // Utente non loggato perche' informazioni in username e password non valide
             // es. campi vuoti o contenenti caratteri non consentiti.
             $login_error_message = translateFN("Username  e/o password non valide");
         }
     } else {
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:login_required.php

示例4:

 if (DataValidator::validate_not_empty_string($_POST['tester_name']) === FALSE) {
     $errorsAr['tester_name'] = true;
 }
 if (DataValidator::validate_string($_POST['tester_rs']) === FALSE) {
     $errorsAr['tester_rs'] = true;
 }
 if (DataValidator::validate_not_empty_string($_POST['tester_address']) === FALSE) {
     $errorsAr['tester_address'] = true;
 }
 if (DataValidator::validate_not_empty_string($_POST['tester_province']) === FALSE) {
     $errorsAr['tester_province'] = true;
 }
 if (DataValidator::validate_not_empty_string($_POST['tester_city']) === FALSE) {
     $errorsAr['tester_city'] = true;
 }
 if (DataValidator::validate_not_empty_string($_POST['tester_country']) === FALSE) {
     $errorsAr['tester_country'] = true;
 }
 if (DataValidator::validate_phone($_POST['tester_phone']) === FALSE) {
     $errorsAr['tester_phone'] = true;
 }
 if (DataValidator::validate_email($_POST['tester_email']) === FALSE) {
     $errorsAr['tester_email'] = true;
 }
 if (DataValidator::validate_string($_POST['tester_desc']) === FALSE) {
     $errorsAr['tester_desc'] = true;
 }
 if (DataValidator::validate_string($_POST['tester_resp']) === FALSE) {
     $errorsAr['tester_resp'] = true;
 }
 if (DataValidator::validate_testername($_POST['tester_pointer'], MULTIPROVIDER) === FALSE) {
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:edit_tester.php

示例5: array

 if (isset($_SESSION['event_msg_id'])) {
     $previous_proposal_msg_id = $_SESSION['event_msg_id'];
     $event_token = '';
 } else {
     /*
      * Costruiamo qui l'identificatore della catena di proposte che portano a
      * fissare un appuntamento.
      */
     $event_token = ADAEventProposal::generateEventToken($id_user, $userObj->getId(), $id_course_instance);
 }
 /*
  * Validazione dei dati: le date proposte devono essere valide e non devono essere antecedenti
  * a quella odierna (come timestamp)
  */
 $errors = array();
 if (DataValidator::validate_not_empty_string($subject) === FALSE) {
     $errors['subject'] = ADA_EVENT_PROPOSAL_ERROR_SUBJECT;
 }
 if (($value = ADAEventProposal::canProposeThisDateTime($userObj, $date1, $time1, $sess_selected_tester)) !== TRUE) {
     $errors['date1'] = $value;
 }
 if (($value = ADAEventProposal::canProposeThisDateTime($userObj, $date2, $time2, $sess_selected_tester)) !== TRUE) {
     $errors['date2'] = $value;
 }
 if (($value = ADAEventProposal::canProposeThisDateTime($userObj, $date3, $time3, $sess_selected_tester)) !== TRUE) {
     $errors['date3'] = $value;
 }
 $datetimesAr = array(array('date' => $date1, 'time' => $time1), array('date' => $date2, 'time' => $time2), array('date' => $date3, 'time' => $time3));
 $message_content = ADAEventProposal::generateEventProposalMessageContent($datetimesAr, $id_course_instance, $notes);
 if (count($errors) > 0) {
     $data = array('testo' => $message_content, 'titolo' => $subject, 'flags' => $type);
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:send_event_proposal.php

示例6: array

/**
 * Users (types) allowed to access this module.
 */
$allowedUsersAr = array(AMA_TYPE_SWITCHER);
/**
 * Performs basic controls before entering this module
 */
$neededObjAr = array(AMA_TYPE_SWITCHER => array('layout'));
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = whoami();
// = admin!
include_once 'include/switcher_functions.inc.php';
/*
 * YOUR CODE HERE
 */
$type = DataValidator::validate_not_empty_string($_GET['list']);
$fieldsAr = array('nome', 'cognome', 'username', 'tipo');
switch ($type) {
    case 'authors':
        $usersAr = $dh->get_authors_list($fieldsAr);
        $profilelist = translateFN('lista degli autori');
        break;
    case 'tutors':
        $usersAr = $dh->get_tutors_list($fieldsAr);
        if (defined('AMA_TYPE_SUPERTUTOR')) {
            $usersAr = array_merge($usersAr, $dh->get_supertutors_list($fieldsAr));
        }
        $profilelist = translateFN('lista dei tutors');
        break;
    case 'students':
    default:
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:list_users.php

示例7: unset

 if (DataValidator::validate_string($_POST['user_city']) === FALSE) {
     $errorsAr['user_city'] = true;
 }
 if (DataValidator::validate_string($_POST['user_province']) === FALSE) {
     $errorsAr['user_province'] = true;
 }
 if (DataValidator::validate_string($_POST['user_country']) === FALSE) {
     $errorsAr['user_country'] = true;
 }
 if (DataValidator::validate_string($_POST['user_fiscal_code']) === FALSE) {
     $errorsAr['user_fiscal_code'] = true;
 }
 if (DataValidator::validate_birthdate($_POST['user_birthdate']) === FALSE) {
     $errorsAr['user_birthdate'] = true;
 }
 if (DataValidator::validate_not_empty_string($_POST['user_birthcity']) === FALSE) {
     $errorsAr['user_birthcity'] = true;
 }
 if (DataValidator::validate_string($_POST['user_birthprovince']) === FALSE) {
     $errorsAr['user_birthprovince'] = true;
 }
 if (DataValidator::validate_string($_POST['user_sex']) === FALSE) {
     $errorsAr['user_sex'] = true;
 }
 if (DataValidator::validate_phone($_POST['user_phone']) === FALSE) {
     $errorsAr['user_phone'] = true;
 }
 if (count($errorsAr) > 0) {
     unset($_POST['submit']);
     $user_dataAr = $_POST;
     $testers_dataAr = $common_dh->get_all_testers(array('id_tester', 'nome'));
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:add_user.php


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