當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。