title: Validate a numeric value range from html form textbox. PHP or Javascript
body: <p>I have a form that contains a number of textboxes i.e. Volome, Gain, Treble, Middle and Bass. Only whole numbers can be entered, which is validated with javascript and the Maxlength is set to, so no problem there.  But how do I make sure that only numbers between 0 and 65535 are entered. </p>
  
  <pre><code>&lt;?php
          $name = $_POST['ampMod'];
          $volume = 'Volume = '. $_POST['volume'];
          $gain = 'Gain = '. $_POST['gain'];
          $treble = 'Treble = '. $_POST['treble'];
          $middle = 'Middle = '. $_POST['middle'];
          $bass = 'Bass = '. $_POST['bass'];
  
  if($volume != null &amp;&amp; $gain != null &amp;&amp; $treble != null &amp;&amp; $middle != null &amp;&amp; $bass != null)
  {
  
          echo "&lt;h3&gt; $name &lt;/h3&gt;";
          echo "&lt;table&gt;&lt;tr&gt;";
          echo "&lt;td&gt;$volume&lt;/td&gt;";
          echo "&lt;td&gt;$gain&lt;/td&gt;";
          echo "&lt;td&gt;$treble&lt;/td&gt;";
          echo "&lt;td&gt;$middle&lt;/td&gt;";
          echo "&lt;td&gt;$bass&lt;/td&gt;";
  }
  else
  {echo ("Please try again. Values must be between 0-65535. 0=Off 65535=Full On 10&lt;br&gt;&lt;a href = \"ampchoice.php\"&gt;Click here to try again!&lt;/a&gt;");}
  ?&gt;
  </code></pre>