Hi all
I am displaying the details of individual people in a form (kind of a booking form) and these details are being taken from a large array stored in a session.
On my script, the html form fields are named as such and are created in a loop based on the number of people on the booking (e.g.):
for($i=1;$i<=$totalcount;$i++) {
name="firstname[$i]"
name="lastname[$i]"
name="nationality[$i]"
}
Now the values of these fields are obtained from my session array however, I might only get a subset of data from the array so the values of $i could be as follows:
name="firstname[2]"
name="lastname[2]"
name="nationality[2]"
name="firstname[4]"
name="lastname[4]"
name="nationality[4]"
name="firstname[12]"
name="lastname[12]"
name="nationality[12]"
What I need to do is when I POST my form to save the details, I need to keep the $i keys so when I update my array, I update the already existing key/value pairs based on the $i values.
Is there a way to do this?
When I currently post my form and echo the POST, all form values are stored into a new array starting at key 0.
Any help would be greatly appreciated.
Regards
kbc1