Get Numeric value from form text field in PHP

Description

The following code shows how to get Numeric value from form text field.

Example


<HTML>/*from  w ww .  j a  v  a  2  s.c o  m*/
<BODY>
<FORM METHOD="POST" ACTION="FormNumericValue.php">
   Enter a numeric value:
  <BR>
  <INPUT TYPE="TEXT" NAME="number">
</FORM>
</BODY>
</HTML>

The following code is for FormNumericValue.php.


<HTML>//from  w  w w  .  j  av  a  2 s.  c o m
<BODY>
<?php
  echo "The number entered was: $number.";
  if ($number > 10)
      echo "<BR>That's a big number.";
?>
</BODY>
</HTML>




















Home »
  PHP Tutorial »
    Form »




PHP Form
Form Demo