Page 1 of 1

checking for a space in a string

Posted: Tue Jun 06, 2006 4:53 am
by hame22
Hi

I want to prevent my users signing up to my site with a username that includes a space in it e.g 'name surname' should not be allowed only 'namesurname' or 'name_surname'.

How could I validate that an entered username does not include any spaces and return an error if it is unvalid?

thanks in advance

Posted: Tue Jun 06, 2006 5:00 am
by twigletmac
strpos() can be used to let you know if there are any spaces

Mac