johnseito Posted March 14, 2008 Share Posted March 14, 2008 Hello everyone, I am wondering how to check a users input, such as is the user input number, character, and the length of character, etc. And for example if I create a field in the table as: text, for a supposely number input can I check it if the user is inputting a number instead of text? phone varchar(30); Any code examples or links would be greatly appreciated. thanks Quote Link to comment Share on other sites More sharing options...
AdRock Posted March 14, 2008 Share Posted March 14, 2008 If you are using a form, you could use some regular expressions to check if they are entering the correct data and length Quote Link to comment Share on other sites More sharing options...
dotBz Posted March 14, 2008 Share Posted March 14, 2008 http://www.php.net/is-numeric http://www.php.net/is-string http://www.php.net/strlen and regular expressions 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.