westminster86 Posted April 3, 2008 Share Posted April 3, 2008 Just a quick question regarding form fields validation. How would i check to see if for instance only letters are entered into a field and fields that should only take digits. Thanks in advance Quote Link to comment Share on other sites More sharing options...
cgm225 Posted April 3, 2008 Share Posted April 3, 2008 Check of the variable is an integer with FILTER_VALIDATE_INT See: http://us3.php.net/manual/en/ref.filter.php#filter.constants for other filters and examples of how to use them. Quote Link to comment Share on other sites More sharing options...
lordfrikk Posted April 3, 2008 Share Posted April 3, 2008 For mono-type validation (only letters or only digits) use filter functions or ctype_xxxx functions (ctype_alpha etc.). For more complex validation, use regular expressions - PCRE. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.