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
validate form
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
Mac