|
Posted by k3pp0 on 02/01/08 17:36
Hello,
I have a registering form with the input fields for realname (two
seperate fields for surname and forename), username, password,
password again and email.
I want to check each each input field and redirect to another page
when all the fields are valid. If not, the form should show up again,
with all the invalid input fields highlighted and with the adequate
error messages displayed.
Therefor, I write a function for every input field, that checks the
validity of it.
I thought I'd do that with regexp/preg_match, but I'm a big newbee...
I already found a quite good solution for the email field (http://
www.ilovejackdaniels.com/php/email-address-validation), what do you
think about it?
So, what I still need, are the validation functions (regexps) for the
surname, forename, username, password an the second password.
The realname (surname/forename) should only contain all letters (also
special characters like an umlaut, ´, ` and all that kind of stuff), a
"-" and a space.
The username should only consist of letters (no special characters),
numbers, "_" and "-" (or do you guys suggest any other allowed
characters?).
For the password, I guess I should allow every possible combination
and check for a minimum lenght...
I hope you guys can help me with those regexps or whatever solution
you suggest for my "problem".
Thanks!
[Back to original message]
|