php validation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zubkola
Forum Newbie
Posts: 1
Joined: Wed Oct 03, 2007 8:22 am

php validation

Post by zubkola »

hi everyone.....

i'm new to php.i need your help.i want the validation code for user registration form.the fields are full name,address,email,password,confirm password ,date of birth,gender.hope [s]u[/s] you can help me....
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post by aceconcepts »

Most validation scenarios are quite obvious.

Be careful with fullname, why not split it into first and last. Also beware of names containing special characters i.e. "-"

You can find lots of email validation scripts on the web (both PHP and Javascript.

passwords obviously need to be compared for integrity reasons and strlen() is often useful. Also, you will probably want to encrypt your password - md5()

DOB depends on what validations you want.

Gender could simply be a select list - Male or Female.
RobbieL
Forum Commoner
Posts: 31
Joined: Fri Mar 23, 2007 5:57 pm

Post by RobbieL »

If you're new to PHP (like me), using a framework like Code Igniter may be helpful. Their built in validation in excellent, and very simple to get going.
Post Reply