How can I check a value entered in a field on my form is a number?
Here's an example:
<?php
$formvalue = "57a";
if(is_numeric($formvalue)) { echo "Is a number"; } else { echo "Not a number"; }
?>
This prints 'Not a number' in this instance.
Comment on this Question and Answer >>>
ASK A QUESTION
More forms PHP Questions
I am taking over a position from another programmer, and want to change some php code, but part of it has me baffled. The code creates a form and after it is filled, the client wants it to go to a separate thank you page – right now, it re-uses the forhow do i validate the name into form ?
How do I escape data that is going into a database?
How can I access information sent through POST on a form?
how to avoid the refresh or goback to submit the post values in database
