I still do not get it
this is my output starting with the data that is passed from the form, so I conclude thta the form works well.
Array ( [firstname] => Angus [lastname] => Stok [age] => 43 [choice] => Array ( [0] => Computing [1] => Science ) )
Thanks for responding to this survey Angus Stok
These are your favorite book categories:
Warning: Invalid argument supplied for foreach() in C:\FoxServ\www\StudentPHP\thankyou.php on line 16
My code is
<?php
print_r($_POST);
$title = "Thank-you";
include("header.php"
;
$firstname = $_POST[firstname];
$lastname = $_POST[lastname];
$age = $_POST[age];
echo "Thanks for responding to this survey $firstname $lastname";
echo "<br><br>";
echo "<b>These are your favorite book categories:</b>";
echo "<br><br>";
foreach ($choice as $category)
{
echo "$category <br>\n";
}
include ("footer.php"
;
?>