Below is a sample of a cell from a table in a form.
There's multiple, similar cells per table row, and there can be multiple rows in the table.
I want to post each row to a different page, and then be able to cycle through each row. So far I've written this for each cell:
<td><?php echo "$inkrementering";?><input type="hidden" name="historik[]" value="<?php echo serialize($inkrementering);?>"></td>
<?php
}
}
?>
</tr>
</table>
<input type="submit" value="Gem træning" name="submit">
</form>
On the recipient page, I have the following code:
foreach ($_POST['historik'] as $historikArray)
{
echo unserialize($historikArray)[3];
}
which has the purpose of:
1) Cycling through all rows, one by one
2) Printing the item in place [3] from each row (just as an example...)
But, I'm getting the error:
Notice: unserialize(): Error at offset 0 of 4 bytes
Anyone know how to fix this?
Or, maybe I'm not on the right track using serialize...?
Any help appreciated! :)