Page 1 of 1

checking for uppercase and lowercase varchars

Posted: Mon Sep 12, 2005 5:07 am
by gurjit
Hi all,

I want to check whether a user has input all lowercase varchars for "username" and all uppercase varchars for "password".

How can i do this?

If possible can this check be done in the query?

Re: checking for uppercase and lowercase varchars

Posted: Mon Sep 12, 2005 5:58 am
by jmut
gurjit wrote:Hi all,

I want to check whether a user has input all lowercase varchars for "username" and all uppercase varchars for "password".

How can i do this?

If possible can this check be done in the query?
preg_match ("%^[A-Z]*$%",$sring) -> only uppercase letters
preg_match ("%^[a-z]*$%",$sring) -> only lowercase letters

Posted: Mon Sep 12, 2005 8:33 am
by neophyte
ctype_alnum()? or ctype_print();

Posted: Tue Sep 13, 2005 3:05 am
by gurjit
Cheers Guys, got it sorted.

Thanks for all the help.

Posted: Tue Sep 13, 2005 3:09 am
by s.dot
you could always strtoupper() or strtolower() before you store any information ;)