Miscellaneous

  Home arrow Miscellaneous arrow Page 7 - Form and Spelling Validation
MISCELLANEOUS

Form and Spelling Validation
By: Matt Wade
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2003-07-20

    Table of Contents:
  • Form and Spelling Validation
  • Common Form Validations
  • Spell Checking
  • Summary

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Form and Spelling Validation -


    (Page 7 of 14 )

    In our password strength function, we will require that a password pass three different validations. First, it must meet a specific length. In our case, we are requiring that a password is at least eight characters. Then, we check to be sure that we have a fair amount of unique characters being used. A password that uses the same few characters repeatedly is not secure. Finally, we validate that there are a combination of numbers and letters and that at least one number has a letter on either side of it.

    <?php
    function checkPassword($password) {
      
    $length strlen ($password);
      if (
    $length &lt8) {
        return 
    FALSE;
      }
      
    $unique strlen (count_chars ($password3));
      
    $difference $unique $length;
      echo 
    $difference;
      if (
    $difference &lt.60) {
        return 
    FALSE;
      }
      return 
    preg_match ("/[A-z]+[0-9]+[A-z]+/"$password);
    }
    ?>

    More Miscellaneous Articles
    More By Matt Wade

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap