Hello:
I have a form with a field called "whichday". This represents the days of the week.
In my form, I have it written as:
<input type="checkbox" name="whichday[]" value="Monday">
<input type="checkbox" name="whichday[]" value="Tuesday">
<input type="checkbox" name="whichday[]" value="Wed">
<input type="checkbox" name="whichday[]" value="Thursday">
Now, I'm passing this form into a script and I was able to verify that the "whichday[]" was working. All four days appeared.
Now, I run the script selecting all four days. My script takes the results in places them in table format. When the script runs, for Which Days:,the table should show me: Monday, Tuesday, Wed, Thurs. Instead, it only shows Thursday. I don't know what's happening to the other three days and why they are not appearing in the list.
Can someone take a look at my script and help me find my error?
Thank you in advance.
Here is the script:
<?php
$name=$_POST["name"];
$email=$_POST["email"];
foreach($whichday as $index => $day)
?>
<table border="0" width="100%">
<tr>
<td width="32%">Name</td>
<td width="68%"><? echo "$name"; ?></td>
</tr>
<tr>
<td width="32%">Email</td>
<td width="68%"><? echo "$email"; ?></td>
</tr>
<tr>
<td width="32%">Days</td>
<td width="68%"><? echo "$day"; ?></td>
</tr>
</table>