title: PHP functions and if/else statements
body: <p>I am trying to write a script that includes if/else statements and functions.  some background</p>
  
  <ul>
  <li><code>$parts</code> first character should have the letter "N"</li>
  <li><code>$desc</code> is suppose to be at least one character long</li>
  <li><code>$price</code> needs to be positive (0 or higher)</li>
  </ul>
  
  <p>if all three of theses requirements are met then it should say "data accepted"  if something is not met (one or all) the "Invalid...." needs to show.</p>
  
  <p>can someone tell me what part of my script I should look at.</p>
  
  <pre><code>&lt;?php
  $parts = $_POST["parts"];
  $desc  = $_POST["desc"];
  $price = $_POST["price"];
  
  $pa = substr($parts, 0, 1);
  $de = strlen($desc);
  
  if ($pa != "N")
   {echo "Invalid Part Number";}
  else
   if ($de &lt;= 1)
    {echo "Invalid Description Length";}
   else
    if ($price &lt;= 0)
     {echo "Invalid Price";}
      else
       {echo "Data Accepted";}
  ?&gt;
  </code></pre>