more web form help needed

  • 16 years ago

    hello again  i need some more help


    this is the list of things  i need this form to do


    1. allow lower and upper case
    2. allow spaces between letters
    3. restrict the number of . , _ - if possible used in each nick
    4.wanted the script set for was alphanumeric with the added exception of - _ . and "[:space:]"


    here is the code im using



    function checkName($nickname,$title){
     $blockWord=array("xxx","xxxx","xxxxx","xxxxx","xxxxxx","xxxx","xxxxx","xxxxx","xxxx","xxxx","xxxx","xxxx","xxxxxxx","xxxxx","xxxx","xxxxx","xxxx","xxxxx");
     $result="";
     if(strlen($nickname)<4){
     $result="$title minimum 4 characters!";
    }
    else if(eregi("([^_a-z.0-9-])",$nickname)){
     $result="Invalid $title !";
     }else{
     for($i=0;$i<count($blockWord);$i++){
       if(strtolower($nickname)==$blockWord[$i]) $result="$title \"".$blockWord[$i]."\" is reserved word !";

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - Rick Osborne