validate form

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
superman
Forum Commoner
Posts: 29
Joined: Tue Jul 08, 2003 2:54 am

validate form

Post by superman »

how to validate a form?
it will check whether it is empty or not, if yes, it will ask user to enter the value, the value for name can't in the numeric form, the IC Number can't in the string form. it also check the email is in the correct format.
thank you
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You need to use functions such as isset() or empty() to check whether any information has been posted. To then check the form of the information you can use functions such as is_numeric(), ctype_alpha(), ctype_alnum() etc.

Mac
Post Reply