Miscellaneous
  Home arrow Miscellaneous arrow Page 7 - Form and Spelling Validation
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
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

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    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


       · 
       · Comments given fo title
       · sorry I ran this function and itdidn't work.
       · Remove the echo statement.
       · td.error {color:C03; font-weight:bold; }is incorrect, should be:td.error...
       · td.error {color: red; font-weight:bold; }
       · :)
       · I dont know how this is supposed to work but it doesnt..I can get the spell...
       · HOLY CRAP! I have been stuck on this for about a week and have spent about 6-10...
     

    MISCELLANEOUS ARTICLES

    - Install Slackware on Your Old PC
    - Firefox Plugins You`re Not Using (and Should...
    - Working with MP3 ID3 Tags in FTP Server Usin...
    - How Switching to Linux Can Make Your Computi...
    - Set Up Your Home Office on Linux: a Guide fo...
    - Putty File Transfer Commands in SSH Protocol
    - Setting Up Ubuntu for Your Home Office
    - Installing Mint Linux
    - Crucial Traits of Awk
    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek