Page 1 of 1

validate form

Posted: Mon Jul 14, 2003 4:20 am
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

Posted: Mon Jul 14, 2003 4:54 am
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