在html隐藏输入中传递更新的值

I am making a project regarding about online examination in which admin can be able to add test and after that it will show it in the div. Inside the div it will show all the list of selected test and therefore, he can be able to delete any test by simple clicking a cross sign. So, I am stuck in the process in which if I am deleting any test and after that I am submitting a form then it is showing me all the test including the deleted test. Below are my code:

<?php  
    if(isset($_POST['addTest']))
    {  
        echo "<br>";
        echo "SELECTED TEST LIST";
        echo "<br>";
        echo '<div style="backfround:white;padding:5px;border:2px solid;overflow:scroll;height:100px;">';
        $fruitList = implode(', ', $_POST['jdb']);
        $jdStore = explode(',',$fruitList);
        $jdValueStore = ""; 

        for($i=0;$i<count($jdStore);$i++)
        {
            $testShowState = "select testId, testName from test where testId= '$jdStore[$i]'";
            $testShowQuery = mysql_query($testShowState);
            $testShowFetch = mysql_fetch_array($testShowQuery);

            echo  $jdValueStore[] =  "<div class='divClass'>

                                          <p>".$testShowFetch['testName']."</p>
                                          <img src='images/deletebttn.gif' alt='delete' class='deleteDiv' />
                                      </div>";
        }

        echo '</div>';
    } 

    $jdTotal = serialize($jdValueStore);
    $encoded = htmlentities($jdTotal);

?>
<input type="hidden" name="jdStoreValue" value="<?php echo $encoded; ?>">
<input type="submit" class="button add" value="Save" style="width:auto;" id="addSave" onclick="myAddSave()" name="myAddSave" >

On The page where I am getting the values:

$jdStoreValue = unserialize($_POST['jdStoreValue']);

for($i=0;$i<count($jdStoreValue);$i++)
{
    echo $jdStoreValue[$i];
}

It is showing me all the test. I don't want a deleted test.

You should remove serialize code.

if(isset($_POST['addTest']))
{  
    echo "<br>";
    echo "SELECTED TEST LIST";
    echo "<br>";
    echo '<div style="backfround:white;padding:5px;border:2px solid;overflow:scroll;height:100px;">';
        $fruitList = implode(', ', $_POST['jdb']);
        $jdStore = explode(',',$fruitList);
        $jdValueStore = ""; 

        for($i=0;$i<count($jdStore);$i++)
        {      
            $testShowState = "select testId, testName from test where testId= '$jdStore[$i]'";
            $testShowQuery = mysql_query($testShowState);
            $testShowFetch = mysql_fetch_array($testShowQuery);
            echo '<input type="hidden" name="fruitList[]" value="'.$testShowFetch['testId'].'" />';
            echo  $jdValueStore[] =  "<div class='divClass'>

                <p>".$testShowFetch['testName']."</p>
                    <img src='images/deletebttn.gif' alt='delete' class='deleteDiv' />
                </div>";
         }

        echo '</div>';
} 
<input type="submit" class="button add" value="Save" style="width:auto;" id="addSave" onclick="myAddSave()" name="myAddSave" >

bind jquery onclick event to cross button which will reduce the count of exam on deleition also update the hidden field.