Page 1 of 1

Small adjustment

Posted: Wed Jun 27, 2007 7:40 am
by oo7ml
I want to create some PHP validation for my Name input box on my form

For my Username input box, i have

Code: Select all

if (preg_match('/^[a-z0-9_]{5,20}$/i', $username))
This checks that the username is 5 - 20 characters in length and that a-z 0-9 _ characters are only used

How do i create a validation similar to above that only checks that the name input box is 1-20 characters in length (any characters can be used)

Thanks

Posted: Wed Jun 27, 2007 7:44 am
by volka
.{1,20}

Posted: Wed Jun 27, 2007 7:45 am
by Gente

Posted: Wed Jun 27, 2007 8:27 am
by volka
*cough* yes, that's better ;)