You are here: Some Regexp questions « PHP Programming Language « IT news, forums, messages
Some Regexp questions

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!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация