please forgive my confusing title, here is my problem:
- set an array variable through $_POST
- check which button has been clicked and process the $_POST variable
What is in my code:
<?php
...
$user = array_filter(array_map('array_filter', $_POST['user']));
...
$submit = isset($_POST['button']) ? trim($_POST['button']) : '';
if ($submit == 'Confirm') {
...do something with $user;
} else if ($submit == 'Cancel') {
...do something else with $user;
}
?>
It appears that when the page is first loaded, $user has been set correctly, however, once the "Confirm" button is clicked, the $name array is lost and cannot be processed. Any idea of how to resolve this will be much appreciated! Many thanks.