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


PHP verifyAlphaNum函数代码示例

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


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

示例1: verifyEmail

        if(empty($email)){
       $errorMsg[]="Please enter your Email";
       $emailERROR = true;
    } else {
       $valid = verifyEmail ($email); /* test for non-valid  email */
       if (!$valid){ 
           $errorMsg[]="Email must be valid";
           $emailERROR = true;
       }
    }
    
            if(empty($credit)){
       $errorMsg[]="Please enter your credit card";
       $creditERROR = true;
    } else {
       $valid = verifyAlphaNum ($credit); /* test for non-valid  email */
       if (!$valid){ 
           $errorMsg[]="Credit card must be valid";
           $creditERROR = true;
       }
    }
    
    
 
    
    //#######################################################
    // we are going to put our forms data into this array so we can save it
    // CHANGES NEEDED make sure the variable matches yours above
    $dataRecord[]=$firstName;
    $dataRecord[]=$lastName;
    $dataRecord[]=$email;
开发者ID:jhegman,项目名称:Portfolio,代码行数:31,代码来源:join.php

示例2: elseif

     $addressERROR = true;
 } elseif (!verifyAlphaNum($address)) {
     $errorMsg[] = "Your address appears to be incorrect.";
     $addressERROR = true;
 }
 if ($netId == "") {
     $errorMsg[] = "Please enter your net ID";
     $idERROR = true;
 } elseif (!verifyAlphaNum($netId)) {
     $errorMsg[] = "Your net ID appears to be incorrect.";
     $idERROR = true;
 }
 if ($phone == "") {
     $errorMsg[] = "Please enter your net ID";
     $phoneERROR = true;
 } elseif (!verifyAlphaNum($phone)) {
     $errorMsg[] = "Your phone number appears to be incorrect.";
     $phoneERROR = true;
 }
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     $query = "INSERT INTO tblCustomer " . "(pmkCustomerId, fldFirstName, fldLastName, fldEmail, fldAddress, fldPhone, fldType) VALUES " . "(?, ?, ?, ?, ?, ?, '" . $checkRecord . "')";
     $results = $thisDatabaseWriter->insert($query, $dataRecord, 0, 0, 2, 0, false, false);
     $message = '<h2>Your Information:</h2>';
     $message_admin = '<h2>Customer Information:</h2>';
     foreach ($_POST as $key => $value) {
         if ($key != "btnSubmit") {
             $message .= "<p>";
             $message_admin .= "<p>";
开发者ID:BikeShopDatabase,项目名称:bikeShop,代码行数:31,代码来源:register.php

示例3: elseif

     $lastNameERROR = true;
 } elseif (!verifyAlphaNum($lastName)) {
     $errorMsg[] = "Your last name appears to have extra character.";
     $firstNameERROR = true;
 }
 if ($email == "") {
     $errorMsg[] = "Please enter your email address";
     $emailERROR = true;
 } elseif (!verifyEmail($email)) {
     $errorMsg[] = "The email address you entered appears to be incorrect.";
     $emailERROR = true;
 }
 if ($netID == "") {
     $errorMsg[] = "Please enter your address";
     $netIDERROR = true;
 } elseif (!verifyAlphaNum($netID)) {
     $errorMsg[] = "Your netID appears to have extra character.";
     $netIDERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2d Process Form - Passed Validation
 //
 // Process for when the form passes validation (the errorMsg array is empty)
 //
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     //
开发者ID:sopalmer,项目名称:cs148,代码行数:31,代码来源:login.php

示例4: elseif

 // SECTION: 2c Validation
 if ($activity == "(Choose One)") {
     $errorMsg[] = "Please select an activity";
     $activityERROR = true;
 }
 if ($title == "") {
     $errorMsg[] = "Please enter a title.";
     $titleERROR = true;
 } elseif (!verifyAlphaNum($title)) {
     $errorMsg[] = "Title includes unknown values.";
     $titleERROR = true;
 }
 if ($maxParticipants == 0) {
     $errorMsg[] = "Please increase the number of participants.";
     $maxParticipantsERROR = true;
 } elseif (!verifyAlphaNum($maxParticipants)) {
     $errorMsg[] = "nice try...";
     $maxParticipantsERROR = true;
 }
 if ($description == "") {
     $errorMsg[] = "Please enter add a description.";
     $descriptionERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 // SECTION: 2d Process Form - Passed Validation
 // Process for when the form passes validation (the errorMsg array is empty)
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
开发者ID:JGuzak,项目名称:RecConnect,代码行数:31,代码来源:createEvent.php

示例5: elseif

 $data1[] = $chords;
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2c Validation
 //
 if ($songName == "") {
     $errorMsg[] = "Please enter your first name";
     $songNameERROR = true;
 } elseif (!verifyAlphaNum($songName)) {
     $errorMsg[] = "Your Song name appears to have extra character(s).";
     $songNameERROR = true;
 }
 if ($artistName == "") {
     $errorMsg[] = "Please enter the Artist's name";
     $artistNameERROR = true;
 } elseif (!verifyAlphaNum($artistName)) {
     $errorMsg[] = "Artist name appears to have an extra character.";
     $artistNameERROR = true;
 }
 if ($tab == "") {
     $errorMsg[] = "Please enter the tab link";
     $tabERROR = true;
 }
 if ($youTube == "") {
     $errorMsg[] = "Please enter the songs youtube link";
     $youTubeERROR = true;
 }
 // should check to make sure its the correct date format
 if ($chords == "") {
     $errorMsg[] = "Please enter chords separated by ,";
     $youTubeERROR = true;
开发者ID:spflynn,项目名称:final,代码行数:31,代码来源:form.php

示例6: elseif

<?php 
if ($firstName == "") {
    $errorMsg[] = "Please enter your first name";
    $firstNameERROR = true;
} elseif (!verifyAlphaNum($firstName)) {
    $errorMsg[] = "Your first name appears to have extra character.";
    $firstNameERROR = true;
}
if ($lastName == "") {
    $errorMsg[] = "Please enter your last name";
    $lastNameERROR = true;
} elseif (!verifyAlphaNum($lastName)) {
    $errorMsg[] = "Your last name appears to have an extra character.";
    $lastNameERROR = true;
}
if ($email == "") {
    $errorMsg[] = "Please enter your uvm affliated email address";
    $emailERROR = true;
} elseif (!verifyEmail($email)) {
    $errorMsg[] = "Your email address appears to be incorrect.";
    $emailERROR = true;
}
if ($height == "") {
    $errorMsg[] = "Please enter your height (in numeric inches)";
    $heightERROR = true;
} elseif (!verifyNumeric($height)) {
    $errorMsg[] = "Your height appears to be incorrect. Make sure it is in numeric inches";
    $heightERROR = true;
}
?>
开发者ID:blatendr,项目名称:cs148,代码行数:30,代码来源:loginForm.php

示例7: elseif

 } elseif (!verifyAlphaNum($StudentNetId)) {
     $errorMsg[] = "Your Net ID appears to have extra character.";
     $StudentNetIdERROR = true;
 }
 if ($ProjectName == "") {
     $errorMsg[] = "Please enter your project name";
     $ProjectNameERROR = true;
 } elseif (!verifyAlphaNum($ProjectName)) {
     $errorMsg[] = "Your project name appears to have extra character.";
     $ProjectNameERROR = true;
 }
 //project due date not required--set default
 if ($CourseName == "") {
     $errorMsg[] = "Please enter your Course name";
     $CourseNameERROR = true;
 } elseif (!verifyAlphaNum($CourseName)) {
     $errorMsg[] = "Your course name appears to have extra character.";
     $CourseNameERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2d Process Form - Passed Validation
 //
 // Process for when the form passes validation (the errorMsg array is empty)
 //
 $dataEntered = false;
 try {
     $thisDatabase->db->beginTransaction();
     if ($ProjectId != "") {
         $query = 'UPDATE tblProjects SET ';
         $query .= 'pmkProjectId = ? , ';
开发者ID:kelton-theresa,项目名称:assignment10,代码行数:31,代码来源:projectform.php

示例8: elseif

     $stateERROR = true;
 } elseif (!verifyAlphaNum($state)) {
     $errorMsg[] = "Your state appears to have extra character.";
     $stateERROR = true;
 }
 if ($province == "") {
     $errorMsg[] = "Please enter your province";
     $provinceERROR = true;
 } elseif (!verifyAlphaNum($lastName)) {
     $errorMsg[] = "Your province appears to have extra character.";
     $provinceERROR = true;
 }
 if ($country == "") {
     $errorMsg[] = "Please enter your country";
     $countryERROR = true;
 } elseif (!verifyAlphaNum($country)) {
     $errorMsg[] = "Your country appears to have extra character.";
     $countryERROR = true;
 }
 if ($email == "") {
     $errorMsg[] = "Please enter your email address";
     $emailERROR = true;
 } elseif (!verifyEmail($email)) {
     $errorMsg[] = "Your email address appears to be incorrect.";
     $emailERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2e.
 // //
 // Process for when the form passes validation (the errorMsg array is empty)
开发者ID:nythomps,项目名称:cs148,代码行数:31,代码来源:form.php

示例9:

 if ($location != "" and !verifyAlphaNum($location)) {
     $errorMsg[] = "The location info appears to contain invalid characters.";
     $locationError = true;
 }
 // cost field can be blank
 if ($cost != "" and !verifyNumeric($cost)) {
     $errorMsg[] = "The cost must be a number.";
     $costError = true;
 }
 // URL field can be blank
 if ($url != "" and !filter_var($url, FILTER_VALIDATE_URL)) {
     $errorMsg[] = "The URL you've provided is invalid.";
     $urlError = true;
 }
 // Description field can be blank
 if ($comments != "" and !verifyAlphaNum($comments)) {
     $errorMsg[] = "Your comments contain invalid characters.";
     $commentsError = true;
 }
 // %^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%
 //
 // SECTION 2d: Process form - passed validation (errorMsg is empty)
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid.</p>";
     }
     // %^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%
     //
     // SECTION 2e: Save data: Insert data into database
     // Check if town is already in towns table
     $townSelectQuery = "SELECT pmkTownId";
开发者ID:bigSiebs,项目名称:assignment10,代码行数:31,代码来源:form.php

示例10: htmlentities

 // form. Note it is best to follow the same order as declared in section 1c.
 $pmkTopicId = (int) htmlentities($_POST["hidTopicId"], ENT_QUOTES, "UTF-8");
 if ($pmkTopicId > 0) {
     $update = true;
 }
 // I am not putting the ID in the $data array at this time
 $Topic = htmlentities($_POST["txtTopic"], ENT_QUOTES, "UTF-8");
 $data[] = $ForumName;
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2c Validation
 //
 if ($Topic == "") {
     $errorMsg[] = "Please enter your topic";
     $firstNameERROR = true;
 } elseif (!verifyAlphaNum($Topic)) {
     $errorMsg[] = "Your first name appears to have extra character.";
     $TopicERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2d Process Form - Passed Validation
 //
 // Process for when the form passes validation (the errorMsg array is empty)
 //
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     //
开发者ID:mbrooks2,项目名称:webForum,代码行数:31,代码来源:topicForm.php

示例11: stripslashes

$email;
$message;
if (@$_POST['submitted']) {
    //create vars from user input
    $name = @$_POST['name'];
    $email = @$_POST['email'];
    $message = @$_POST['message'];
    // if magic quotes on, remove Magic Quotes effect
    if (get_magic_quotes_gpc()) {
        $name = stripslashes($name);
        $email = stripslashes($email);
        $message = stripslashes($message);
    }
    //Validate user input. Create error array to store errors
    $error_msg = array();
    $valid = verifyAlphaNum($name, 'Write your name here.');
    if (!$valid) {
        $error_msg[] = 'Please provide a valid name.';
        $name_error = '<span class="error">Name must be letters, numbers, spaces, and dashes only.</span>';
    }
    $valid = verifyEmail($email, 'Write your email address');
    if (!$valid) {
        $error_msg[] = 'Please provide a valid email address.';
        $email_error = '<span class="error">Email must be a valid format (e.g. john@yahoo.com).</span>';
    }
    $message = cleanText($message);
    if ($message == 'Write your message here.') {
        $error_msg[] = 'Please provide a valid message.';
        $message_error = "<span class=\"error\">Message can only contain letters, numbers and basic punctuation \" ' - ? ! </span>";
    }
    // if no errors, send email
开发者ID:carterggg,项目名称:sk8tarded,代码行数:31,代码来源:validation.php

示例12: elseif

     $emailERROR = true;
 } elseif (!verifyAlphaNum($state)) {
     $errorMsg[] = "Your state's name appears to be incorrect.";
     $emailERROR = true;
 }
 if ($zip == "") {
     $errorMsg[] = "Please enter your zip code";
     $emailERROR = true;
 } elseif (!verifyAlphaNum($zip)) {
     $errorMsg[] = "Your zip code appears to be incorrect.";
     $emailERROR = true;
 }
 if ($budget == "") {
     $errorMsg[] = "Please enter your budget";
     $emailERROR = true;
 } elseif (!verifyAlphaNum($budget)) {
     $errorMsg[] = "Your budget appears to be incorrect.";
     $emailERROR = true;
 }
 //
 //
 //
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2d Process Form - Passed Validation
 //
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     //
开发者ID:pressthang,项目名称:cs148final,代码行数:31,代码来源:custom.php

示例13: elseif

     $studentNetIdError = true;
 } elseif (!verifyAlphaNum($studentNetId)) {
     $errorMsg[] = "Your net ID appears to have extra character.";
     $studentNetIdError = true;
 }
 if ($studentEmail == "") {
     $errorMsg[] = "Please enter your email address";
     $emailERROR = true;
 } elseif (!verifyEmail($studentEmail)) {
     $errorMsg[] = "Your email address appears to be incorrect.";
     $emailERROR = true;
 }
 if ($advisorNetId == "") {
     $errorMsg[] = "Please enter your advisor's net ID";
     $advisorNetIdError = true;
 } elseif (!verifyAlphaNum($advisorNetId)) {
     $errorMsg[] = "Their net ID appears to have extra character.";
     $advisorNetIdError = true;
 }
 if ($catalogYear == "select") {
     $errorMsg[] = "Please choose the catalog year";
     $catalogYearError = true;
 }
 if ($major == "select") {
     $errorMsg[] = "Please choose your major";
     $majorError = true;
 }
 if ($minor == "select") {
     $errorMsg[] = "Please choose your minor";
     $minorError = true;
 }
开发者ID:skswanke,项目名称:CS148_FINAL,代码行数:31,代码来源:form.php

示例14: filter_var

 $fldCity = filter_var($_POST["txtFldCity"], FILTER_SANITIZE_EMAIL);
 $dataRecord[] = $fldCity;
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2c Validation
 //
 // Validation section. Check each value for possible errors, empty or
 // not what we expect. You will need an IF block for each element you will
 // check (see above section 1c and 1d). The if blocks should also be in the
 // order that the elements appear on your form so that the error messages
 // will be in the order they appear. errorMsg will be displayed on the form
 // see section 3b. The error flag ($emailERROR) will be used in section 3c.
 if ($userID == "") {
     $errorMsg[] = "Please enter a User ID";
     $firstNameERROR = true;
 } elseif (!verifyAlphaNum($userID)) {
     $errorMsg[] = "Your User ID appears to contain a non-alphanumerical character.";
     $firstNameERROR = true;
 }
 if ($fldEmail == "") {
     $errorMsg[] = "Please enter your email";
     $emailERROR = true;
 } elseif (!verifyEmail($fldEmail)) {
     $errorMsg[] = "Incorrect email address";
     $emailERROR = true;
 }
 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 //
 // SECTION: 2d Process Form - Passed Validation
 //
 // Process for when the form passes validation (the errorMsg array is empty)
开发者ID:kohara2794,项目名称:SocialSport,代码行数:31,代码来源:form.php

示例15: verifyPass

 if (empty($Password)) {
     $errorMsg[] = "Please enter your Password";
     $PasswordERROR = true;
 } else {
     $valid = verifyPass($Password);
     /* test for non-valid  data */
     if (!$valid) {
         $errorMsg[] = "I'm sorry, the username you entered is not valid.";
         $PasswordERROR = true;
     }
 }
 if (empty($AccessToken)) {
     $errorMsg[] = "Please enter your Access Token";
     $AccessTokenERROR = true;
 } else {
     $valid = verifyAlphaNum($AccessToken);
     /* test for non-valid  data */
     if (!$valid) {
         $errorMsg[] = "I'm sorry, the Access token you entered is not valid.";
         $AccessTokenERROR = true;
     }
 }
 //############################################################################
 //
 // Processing the Data of the form
 //
 if (!$errorMsg) {
     if ($debug) {
         print "<p>Form is valid</p>";
     }
     //############################################################################
开发者ID:apdisant,项目名称:modnod,代码行数:31,代码来源:register.php


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