|
Hi,
I created a 2 part form where a user selects the number of employees on the first page, which determines the number of form field sets on the next page. I'm stuck on how to then send that data in the resulting email.
The form fields are created on the second page with this:
$i = 1;
while ($i <= $_POST['empno']) {
echo "<tr><td align=right>Employee ";
echo $i;
echo " Name/ID:</td><td><input name=emp";
echo $i;
echo " size=20></td><td align=right>Date of Birth:</td><td><input name=emp";
echo $i;
echo "dob size=12></td></tr>";
$i = $i + 1;
}
So it produces the form fields emp1 and emp1dob, emp2 and emp2dob, etc. depending on the number of employees selected.
How do I then set variables to place in the body message for the form field names and values?
This doesn't work:
$i = 1;
While($i <= $empno) {
$emp[$i]=$_POST['emp'.$i];
$emp[$i]dob=$_POST['emp'.$i.'dob'];
$i = $i + 1;
}
Am I close? Thanks!
|