https://www.coffeecup.com/forums/web-fo … on/?page=1
and everything is working fine except for the checkboxes. It just ouputs as "Array".
The line " echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>'

but in the Session post (which is what I want to show) it just says Array, because that is what a checkbox field is, an Array (I guess - not an expert here).
Radio buttons work fine using this approach, as do dropdowns, but not checkboxes.
I've read that it possibly has to do with the checkbox Array being inside the Session post array (array inside of an array), but I can't find a solution on how to define it correctly to look for the checkbox[] options, rather than just returning the checkbox name as an Array?
Clear as mud right?
areyou is the name of the checkbox array. Output is always " Are you: Array "
<?php
$post = $_SESSION['post']; // This is getting the post array
$interested = $post['interested']; // This is getting which house
$firstname = $post['firstname']; // This is getting firstname
$lastname = $post['lastname']; // This is getting lastname
$streetaddress = $post['streetaddress']; // This is getting address
$city = $post['city']; // This is getting city
$state = $post['state']; // This is getting state
$postalcode = $post['postalcode']; // This is getting postal code
$emailaddress = $post['emailaddress']; // This is getting email
$areyou = $post['areyou']; // This is the checkbox array which has four options
// Add more as needed for each input on your form. Adjust to your input name.
if(isset($_SESSION['post'])) {echo'You made it to my page.<br><br> Here is what you chose on my form.<br><br>
'.$interested.'<br><br>
First Name: '.$firstname.'<br><br>
Last Name: '.$lastname.'<br><br>
Street Address: '.$streetaddress.'<br><br>
City: '.$city.'<br><br>
State: '.$state.'<br><br>
Postal Code: '.$postalcode.'<br><br>
Email: '.$emailaddress.'<br><br>
Are you: '.$areyou.'<br><br>
Refresh your browser to see the Session unset.<br><br>
Here\'s the session array. The one that holds the form variables is named post.';
echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>';
}
else{echo 'You need to make choices <a href="dont-unset-variables/index.html">on my form</a>.';
}
unset($_SESSION['post']); // This unsets the $_SESSION['post'] array
// Here's how to unset one variable.
//$key=array_search($post['number'],$_SESSION['post']);
// if($key!==false) unset($_SESSION['post'][$key]);
?>
Any advice would be greatly appreciated!