~n[EO]n~ Posted October 4, 2007 Share Posted October 4, 2007 hi anybody knows how to validate form field for numbers, text etc... just one line example will do if (empty($_REQUEST['co_telephone'])) $app->error('Please enter Telephone'); // i have validated like this but i only want to accept numbers 9 characters only, it only checks if it is blank or not any help will be most welcome... Link to comment https://forums.phpfreaks.com/topic/71805-help-on-this-please/ Share on other sites More sharing options...
jscix Posted October 4, 2007 Share Posted October 4, 2007 if (empty($_REQUEST['co_telephone']) || !(is_numeric($_REQUEST['co_telephone'])) || strlen($_REQUEST['co_telephone']) !== 9) { $app->error('Please enter Telephone'); } Link to comment https://forums.phpfreaks.com/topic/71805-help-on-this-please/#findComment-361622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.