Guys i really need help! I need to retrieve data from the database with checkbox. I need to get sum of the items that were clicked and direct the user in another page to show the result. This is my code

 <?php
$con = mysql_connect('localhost','root','root')or die(mysql_error());
$db = mysql_select_db('rizal',$con)or die(mysql_error());
$acode = $_SESSION['acode'];
$query = mysql_query("SELECT tdno, dueamount FROM taxdue where acode ='$acode'")or die(mysql_error());

 ?>
 <form Method="post" Action="total.php" >
    <table>
    <tr>
         <td width="20%" align="center">  </td>
         <td width="20%" align="center">Tax Declaration </td>
         <td width="20%" align="center">Amount</td>
    <tr>
    <?php  
        while($result = mysql_fetch_assoc($query))
        {
        $i++;
    ?>

          <tr>
            <td width="20%" align="center">
            <input name="<?php echo $result['taxid']?>" type="checkbox" id="<?php echo $result['taxid']?>" value="<?php echo $result['taxid']?>">
            </label></td>
            <td width="20%" align="center"><?php echo $result['tdno']?></td>
            <td width="20%" align="center"><?php echo $result['dueamount']?></td>
          </tr>
    <?php
    }
    ?>
             <tr>
            <td align="center"><input type="submit" name="Submit" value="Submit" /></td>
            <td align="center"> </td>
            </tr>
            </form>
          </table>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.