I am trying to crerate a form with two sets of check boxed. i can get them to print with:
$email = _POST['email']
$a[blue]=$_POST['a'];
foreach ($a as $aname )
{
echo "$aname";
}
$b=$_POST['b'];
foreach ($b as $bname)
{
echo "$bname";
}
but in need them to mail to me and to echo in a table when submitted like this:
$formsent = mail("
[email protected]","Submition Results",
"Email: $email\r\n
Selections set 1: $aname\r\n
Selections set 2: $bname",
"From: $email\r\mBounce-to:
[email protected]");
if($formsent) {
echo"
<table>
<tr><td colspan='2'>Selections</td></tr>
<tr><td>Set 1</td><td>$aname</td></tr>
<tr><td>Set 2</td><td>$bname</td></tr>
</table>";
this is the form i am using for an example
<form name="form1" method="post" action="php.php">
Email
<input type="text" name="email"><br>
Select all that apply<br>
<input type="checkbox" name="a[]" value="opt 1">opt 1<br>
<input type="checkbox" name="a[]" value="opt 2">opt 2<br>
<input type="checkbox" name="a[]" value="opt 3">opt 3<br><br>
Select all that apply<br>
<input type="checkbox" name="b[]" value="opt a">opt a<br>
<input type="checkbox" name="b[]" value="opt b">opt b<br>
<input type="checkbox" name="b[]" value="opt c">opt c<br>
<input type="submit" name="Submit" value="Submit">
</form>
S.K