Jump to content

[SOLVED] Adding to session array multiple times


xtiancjs

Recommended Posts

Hi ,

I have a form which adds names to a list 3 at a time. I have it adding the first lot of 3 no problem, when I try and resubmit the form the original 3 names are replaced by the later 3. I am trying to have them add to the original so a larger list is formed.  My HTML:

<input id="firstname" type="text" name="firstname[]" size="20"><br>
<input id="firstname" type="text" name="firstname[]" size="20"><br>
<input id="firstname" type="text" name="firstname[]" size="20">

 

My PHP code:

 foreach($_POST['firsname'] as $value) {

$_SESSION['firstname'] = $value ;

}

 

Any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.