My suggestion for you is send the session item key to page2 and there you check whether the button is accepted or not.
I've created an example for you.
PAGE 1
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
$array = array("Mary", "Paul", "John", "Peter");
$_SESSION['names'] = $array;
foreach ($_SESSION['names'] as $key => $value) {
echo '<form action="page2.php" method="post"">';
echo '<input type="hidden" name="action" value="' . $key . '">';
echo '<button name="acceptGroup">accept</button>';
echo '<button name="declineGroup">decline</button>';
echo '</form>';
}
?>
</body>
</html>
PAGE 2
<?php
session_start();
if(isset($_REQUEST["acceptGroup"]))
{
echo 'accept';
echo '<br/>';
}
else
{
echo 'decline';
echo '<br/>';
}
echo $_SESSION['names'][$_REQUEST["action"]];