I am trying to post a form to $wp_session which is working fine - however when I perform it again it overwrites the array that I have put there in the first place, I need the arrays to carry on building up like a collection / shopping basket.
My form:
<form class="form1" method="post" action="" id="form1">
<fieldset>
<ul>
<label for="name">Exercise ID</label><span>
<input type="text" name="ExerciseID" placeholder="Exercise ID" class="required" role="input" aria-required="true"/></span>
<label for="name">Exercise Reps</label><span>
<input type="text" name="Sets" placeholder="Sets" class="required" role="input" aria-required="true"/></span>
<label for="name">Exercise Reps</label><span>
<input type="text" name="Reps" placeholder="Sets" class="required" role="input" aria-required="true"/></span>
<input class="submit .transparentButton" value="Next" type="submit" name="Submit"/>
</ul>
<br/>
</fieldset>
</form>
And the php:
<?php
global $wp_session;
if (isset($_POST['Submit'])) {
$wp_session['collection'] = array($POST['ExerciseID'],$_POST['Sets'],$POST['Reps']);
}
print_r($wp_session);
?>
Many thanks in advance.