arrays - PHP Dropdown value * Price computation is not accurate it is being doubled -


product - 1 * 19.99

total : 59.97

the computation inaccurate please me code literally don't know i'm new in php appreciated thank you.

for loop code on dropdown

<td><select name="cboqty[<?php echo($i); ?>]">                  <?php                  for($qty[$i]=0; $qty[$i]<=5; $qty[$i]++)                 echo '<option>' .$qty[$i]. '</option>';                 ?>              </select>           </td> 

process button

if(isset($_get["cboqty"]))      {          $mycbo = $_get["cboqty"];                  foreach ( $_session["cart"] $i )          {              $_session["amounts"][$i]  += $mycbo[$i] * $amounts[$i];          }         } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -