title: Checking if a variable is greater than zero
body: <p>I am just about to complete my workshop invoicing system but am stumped with the payment module. It basically lists the amount of the invoice, any payments made and gives a balance. The bottom of the form has a html input table to enter an amount to be paid against the said invoice, once the submit button pressed. It writes this to the database, reloads the top of the page and displays the new balances. When the amount outstanding reaches zero, the bottom of the page should read "No payment required" instead of the HTML form. My code to do this is:</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>$balbf =  $invtotal1-$payment;
  $balance = number_format((float)$balbf, 2, '.', '');
  
  if ($balance &lt;= 0.00) {
      $color = 'red';
  } else {
      $color = 'black';
  }
  
  $bal = ($currency."". number_format((float)$balance, 2, '.', ''));
  //MAKE PAYMENT
  if(isset($_GET['submit']))
  { 
      $amnt = $_GET['amount'];
      $amount = number_format((float)$amnt, 2, '.', '');
      $type = $_GET['type'];
  
      if ($amount &gt;=0.01){
          $pay = "INSERT INTO generalledger (date, account_code, amount, description, supplier_invoice, user_input) VALUES ('$inputdate','1060','$amount','$type payment','INV     $inv','$user')";
  
          $payinv=mysql_query($pay);
      }
  
      //REFRESH TOP WINDOW
      echo "&lt;body onload=parent.payment.window.location.reload()&gt;";
      //CHECK IF BALANCE OUTSTANDING
      if ($balance &lt;= 0.00){
          echo "No payment due.";
          exit();
      }else{ 
  </code></pre>
  
  <p>===> here goes the html form code</p>
  
  <p>It does not work though. If I refresh the page once it reaches zero, it does as it should. Am I missing something? The page is made of two pages in a frame (I know, don't hate me for using frames). I know also that using <code>mysql_query</code> is deprecated but its the only format I know.  I can post the whole code or pm if required. Thanks to all for your help....again.</p>