Hi I have an array $member_details.
Is it possible to try and Post this array across using a form?
at the moment I am using:
<input type="hidden" name="member_details" value="<?php print $member_details;?>" />
and attempting to re-access it using
$member_details = $_POST['member_details'];
however this does not work, if this is not the method to achieve this I would appriciate suggestions on the right ones.
Thanks in advance
Posting an array from a form
Moderator: General Moderators
Try using serialize() to convert the array in string form... send it accross the form... and unserialize() it in your script later to get back to array form.
Code: Select all
<?php
foreach($member_details as $key => $value)
{
echo "<input type='hidden' name='member_details[$key]' value='$value'>\n";
}
?>