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


PHP has_max_length函数代码示例

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


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

示例1:

 if (!preg_match("/^[0-9]{1}-[0-9]{2}-[0-9]{2}-[0-9a-zA-Z]{2}-[0-9]{3}\$/", $_POST["dr_no"])) {
     //DR NO. not like 1-15-09-MM-002
     $_SESSION["error_messages"][] = "Invalid DR-No.";
     $flag = 1;
 } else {
     if (check_drno($_POST["dr_no"]) === 0) {
         $_SESSION["error_messages"][] = "DR-No Not in database.";
         $flag = 1;
     } else {
         if (check_drno_approval($_POST["dr_no"]) === 0) {
             $_SESSION["error_messages"][] = "DR-No Already Approved.";
             $flag = 1;
         }
     }
 }
 if (!has_max_length($_POST["loc_mod"], 50) || !has_max_length($_POST["ref_drawing"], 50) || !has_max_length($_POST["reason_temp_chng"], 50) || !has_max_length($_POST["jumper_desc"], 50) || !has_max_length($_POST["remarks"], 50)) {
     //text fields with over 50 length data mustn't be allowed
     $_SESSION["error_messages"][] = "Text Fields Mustn't Have More Than 50 Characters.";
     $flag = 1;
 }
 if (!preg_match("/^[0-9]{1}\$/", $_POST["tag_unit"])) {
     $_SESSION["error_messages"][] = "Invalid Tag Unit.";
     $flag = 1;
 }
 if (!preg_match("/^[0-9]{1}\$/", $_POST["tag_subsys"])) {
     $_SESSION["error_messages"][] = "Invalid Tag Sub System.";
     $flag = 1;
 }
 if (!preg_match("/^[0-9a-zA-Z]{3}\$/", $_POST["tag_sys"])) {
     $_SESSION["error_messages"][] = "Invalid Tag System.";
     $flag = 1;
开发者ID:ashk43712,项目名称:Jumper,代码行数:31,代码来源:layout1_edit.php

示例2: validate_max_length

function validate_max_length($field_with_max_length)
{
    foreach ($field_with_max_lngth as $field => $max) {
        $field = trim($_POST[$field]);
        if (!has_max_length($field, $max)) {
            $errors["{$field}"] = ucfirst($field) . " is too long";
        }
    }
}
开发者ID:badadiss,项目名称:basic-CMS,代码行数:9,代码来源:functions.php

示例3: validate_max_lengths

function validate_max_lengths($fields_with_max_lengths)
{
    global $errors;
    foreach ($fields_with_max_lengths as $field => $max) {
        $value = trim($_POST[$field]);
        if (!has_max_length($value, $max)) {
            $errors[$field] = fieldname_as_text($field) . " is to long";
        }
    }
}
开发者ID:AhmedMedo,项目名称:Content,代码行数:10,代码来源:validation_functions.php

示例4: validate_max_lengths

function validate_max_lengths($fields_max_length)
{
    global $errors;
    foreach ($fields_max_length as $field => $max) {
        $value = trim($_POST[$field]);
        if (!has_max_length($value, $max)) {
            $errors[$field] = ucfirst($field) . "is to long";
        }
    }
}
开发者ID:raj143225,项目名称:Assignment,代码行数:10,代码来源:validate.php

示例5: validate_max_lengths

 function validate_max_lengths($fields_with_max_lengths)
 {
     global $errors;
     // Using an assoc. array
     foreach ($fields_with_max_lengths as $field => $max) {
         $value = trim($_POST[$field]);
         if (!has_max_length($value, $max)) {
             $errors[$field] = ucfirst($field) . " is too long.<br />";
         }
     }
 }
开发者ID:Keav,项目名称:phpcms,代码行数:11,代码来源:basic.php

示例6: validate_max_lengths

function validate_max_lengths($fields_with_max_length)
{
    global $errors;
    // Using an assoc array
    foreach ($fields_with_max_length as $field => $max) {
        $value = trim($_POST[$field]);
        if (!has_max_length($value, $max)) {
            $errors[$field] = fieldname_as_text($field) . " is too long.";
        }
    }
}
开发者ID:blotted,项目名称:test_site,代码行数:11,代码来源:validation_functions.php

示例7: array

                 } else {
                     if ($image == 'card_6') {
                         $card_six = 'checked';
                         $pos = 5;
                     }
                 }
             }
         }
     }
 }
 // User input Errors
 $errors = array();
 if (!has_presence($greeting)) {
     $errors['greeting_blank'] = "Please provide a greeting for your E-Card.";
 }
 if (!has_max_length($greeting, 500)) {
     $errors['greeting'] = "Please limit your greeting to 500 characters.";
 }
 if (!has_presence($friendfirst)) {
     $errors['friendfirst_blank'] = "Please provide your friend's name.";
 }
 if (!has_presence($toemail)) {
     $errors['toemail_blank'] = "Please provide your friend's email address.";
 }
 if (!has_presence($firstname)) {
     $errors['firstname_blank'] = "Please provide your first name.";
 }
 if (!has_presence($fromemail)) {
     $errors['fromemail_blank'] = "Please provide your email address.";
 }
 if (!has_presence($image)) {
开发者ID:KathleenImbert,项目名称:ecard-generator,代码行数:31,代码来源:ecard.php

示例8: validate_max_lengths

function validate_max_lengths($fields_with_max_lengths, $warning_me = false)
{
    global $errors;
    global $warnings;
    // Expects an assoc. array
    foreach ($fields_with_max_lengths as $field => $max) {
        $value = trim($_POST[$field]);
        if (!has_max_length($value, $max)) {
            if ($warning_me) {
                $warnings[$field] = fieldname_as_text($field) . " is too long";
            } else {
                $errors[$field] = fieldname_as_text($field) . " is too long";
            }
        }
    }
}
开发者ID:kamy333,项目名称:kamy,代码行数:16,代码来源:validation_functions.php


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