@SaranacLake here is the code used if you need to see what I did:
<?php
session_start();
if(isset($_SESSION['plan'])) {
echo '<p>Current Stored Session Data</p><p>';
print_r($_SESSION['plan']);
echo '</p>';
}
$products = [
'Plan A' => [
'name' => 'Basic Plan',
'cost' => 10,
],
'Plan B' => [
'name' => 'Standard Plan',
'cost' => 20,
],
'Plan C' => [
'name' => 'Basic Plan',
'cost' => 50,
],
];
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$_SESSION['plan'] = $_POST['plan'];
echo "You chose,\n Our {$products[$_POST['plan']]['name']} and that costs \${$products[$_POST['plan']]['cost']}";
if(isset($_SESSION['plan'])) {
echo '<p>After the last request Session Data</p><p>';
print_r($_SESSION['plan']);
echo '</p>';
}
}
?>
<!doctype html>
<html>
<head></head>
<body>
<form method='post'>
<table>
<tr>
<td></td>
<td><input type='submit' name='plan' value='Plan A'></td>
<td><input type='submit' name='plan' value='Plan B'></td>
<td><input type='submit' name='plan' value='Plan C'></td>
</tr>
<tr>
<td>Free stuff</td>
<td>X</td>
<td>Y</td>
<td>Y</td>
</tr>
<tr>
<td>Account Access</td>
<td>Y</td>
<td>Y</td>
<td>Y</td>
</tr>
<tr>
<td>Cost</td>
<td>$10</td>
<td>$20</td>
<td>$50</td>
</tr>
</table>
</form>
</body>
</html>