Grouping $_Session outputs

So i have 3 form fields. Each time they are submitted the inputs are display as well as the previous inputs are display. Each time the set of inputs are submitted, each output is put into a div with the same name. That name is increased by one each time. So the first time submit is hit there is 3

then second submit is hit there are 3
and 3
.

What i need to do is wrap each group of

. So if the submit button has been hit twice there should be :
[php]
[/php]

Let me know if it would be easier if i show you have i am getting each

Here is my code… I will make a picture in just a minute…

[php]

<?php session_start(); ?> <?php if(!isset($_SESSION['counter'])){ $_SESSION['counter'] ='1'; } if($_POST) $_SESSION['name'] .= '
'.$_POST['name'].'
'; echo $_SESSION['name'] ; ?> <?php if($_POST) $_SESSION['email'] .= '
'.$_POST['email'].'
'; echo $_SESSION['email'] ; ?> <?php if($_POST) $_SESSION['phone'] .= '
'.$_POST['phone'].'
'; echo $_SESSION['phone'] ; ?> <?php if($_POST) $_SESSION['counter']++; ?> <?php if($_POST[reset]) { unset($_SESSION['counter']); unset($_SESSION['name']); unset($_SESSION['email']); unset($_SESSION['phone']); } ?>
Name:
Armor:
Strength:

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service