PHP Javascript存储项目列表并在单击按钮后更新操作

I have drafted one code for my situations, but it needs your help. I have the html table listing items. Each have one approve button and reject button. When click button, it will store in the list or array. Then in the end if user click the save button. it will handle the store list or array. Is there any sample code or any instructions to help me to do?

<?php 
$sel2approve=null;
function approve($temp)
{
    if($sel2approve==null)
        $sel2approve=array($temp);
    else
        $sel2approve=$sel2approve+array($temp);

}
$sel2reject=null;
function reject($temp)
{
    if($sel2reject==null)
        $sel2reject=array($temp);
    else
        $sel2reject=$sel2reject+array($temp);

}
?>

<a href=""> Aprrove </a><a href="">Reject</a> 

<a href="updateAll?approvelist=N%3B&rejectlist=N%3B"> Save</a>