text: Q:
  
  php function call parameters not passing
  
  I'm trying to pass a bunch of variables in php to a function when a button is pressed. The button triggers the function fine but some of the variables have incorrect values.
          <?php
            function Commit($TID,$total,$itemCount,$barcoded,$barcodedQTY,$nonBarcoded,$nonBarcodedQTY)
            {
              var_dump($TID); //int 2 - correct
              var_dump($total); //string '0.00' (length=4) - incorrect
              var_dump($itemCount); //int 1 -incorrect value
              var_dump($barcoded); // array (empty) // incorrect
              var_dump($barcodedQTY); // array (empty) // incorrect
              var_dump($nonBarcoded); // array (empty) // incorrect
              var_dump($nonBarcodedQTY); //null - incorrect
  
            }
            var_dump($TID); // int 2
            var_dump($total); // string "87.80
            var_dump($itemCount);// int 3
            var_dump($barcoded); // array (size=1) 0 => string '1' (length=1)
            var_dump($barcodedQTY); // array (size=1) 0 => int 4
            var_dump($nonBarcoded); // array (size=1) 0 => string '14' (length=2)
            var_dump($nonBarcodedQTY); // array (size=1) 0 => string '4' (length=1)
            if (isset($_REQUEST['commit']))
            {
              if(isset($TID,$total,$itemCount,$barcoded,$barcodedQTY,$nonBarcoded,$nonBarcodedQTY))
              {
                Commit($TID,$total,$itemCount,$barcoded,$barcodedQTY,$nonBarcoded,$nonBarcodedQTY);
              }
              else
              {
                echo 'not all variables were set!';
              }
            }
          ?>
  
        <div class="row" id="powerwidgets">
          <div class="col-md-12 bootstrap-grid">
              <form>
              <button class="btn btn-success" name="commit" style="float:right;margin-right:5em">Commit</button>
              <button class="btn btn-danger" name="revert" style="float:right;margin-right:14em" onClick="location.href ='index.php'">Cancel</button>
            </form>
        </div>
      </div>
  
  A:
  
  You call commit with the variables:
  $TID,$total,$itemCount,$barcoded,$barcodedQTY,$nonBarcoded,$nonBarcodedQTY
  
  Chances are you haven't confirmed that they all have values. You need to check that for each one with isset() - you can also do this in a ternary operator.
  // isset check before assigning variables
  
  if (!isset($_REQUEST['TID'], $_REQUEST['total'], ...)) die(); // something wasn't set
  
  $TID = $_REQUEST['TID'];
  $total = $_REQUEST['total'];
  ...
  
  /////////////////////////
  /////////////////////////
  
  // ternary operators
  
  $TID = isset($_REQUEST['TID']) ? $_REQUEST['TID'] : "default value"; // don't forget to sanitize!
  $total = isset($_REQUEST['total']) ? $_REQUEST['total'] : "another default value"; // don't forget to sanitize!
  
  // if default values are not desired, just set the "default" as ""
  // and check if variables != ""
  
  Without more code though, this is about as much help as you can get.
  
  