Newbie pattern question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I have this function

 function validate_name($name) {

  if(ereg("^[a-zA-Z0-9_]{2,30}$", $name)) {

   return true;

  } else {

   return false;

  }

 }

If i enter a name like John for exemple everything is ok but if i enter John Doe the function return false.

Where is the problem?

Thanks

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux