Php在表中添加提交的值

I have a page when an user must add some names (selected ones or new) in a table and watch the results,I did a page where an user can select names add click on a Submit button to add in the list (table), my problem is when an user select a name (from a list in the DB) and submit (I used a popup form), the name is added in the table,but for the second time, when he choose another name to add in the list the last name is replaced by the last he selected. Here is the piece of code:

  <table cellpadding="0" cellspacing="0" border="0" class="display" >

    <tbody>

    <?php
    //$names :variable for the submitted value from the popup form
    foreach(array($_POST['authors'])as $names){
    echo"<tr>";
    echo"<td>";
    echo"$names";
    echo"</td>";
    echo"<td>";
    echo'<a href="#" class="up"></a>';
    echo'<a href="#" class="down"></a>';
    echo'<a href="#" class="delrow"></a>';
    echo"</td>";
    echo"</tr>";
     }
     ?>
 </tbody>
 </table>

Your code as written will only handle the results from the most recent submission, ignoring all previous submissions. What you need to do is add a hidden field to your form that stores previous names, and then parse that field in addition to the new one.

You should store the inserted authors name in the user session.