Hey guys, I've been working on this for like 2 days now and I know it's something pretty simple to do, I'm just a rookie with php lol. Basically I have checkbox forms that I want to email all the checked values in.
Here is my html:
<table class="pstable">
<tr>
<td>Lot #</td>
<td>Plan</td>
<td>Yds</td>
<td>Scaffold U</td>
<td>Lath</td>
<td>Stone</td>
<td>Scratch</td>
<td>Brown</td>
<td>Foam</td>
<td>Finish</td>
<td>Prep</td>
<td>Scaffold D</td>
<td>Cleanup</td>
</tr>
<tr>
<td><label><input type="checkbox" name="lot[]" value="3" />3</label></td>
<td><label><input type="checkbox" name="plan[]" value="3B" />3B</label></td>
<td><label><input type="checkbox" name="yards[]" value="415" />415</label></td>
<td><label><input type="checkbox" name="scaffoldU[]" value="456" />456</label></td>
<td><label><input type="checkbox" name="lath[]" value="1,182.75" />$1,182.75</label></td>
<td><label><input type="checkbox" name="stone[]" value="560.00" />$560.00</label></td>
<td><label><input type="checkbox" name="scratch[]" value="498.00" />$498.00</label></td>
<td><label><input type="checkbox" name="brown[]" value="747.00" />$747.00</label></td>
<td><label><input type="checkbox" name="foam[]" value="633.00" />$633.00</label></td>
<td><label><input type="checkbox" name="finish[]" value="622.50" />$622.50</label></td>
<td><label><input type="checkbox" name="prep[]" value="150.00" />$150.00</label></td>
<td><label><input type="checkbox" name="scaffoldD[]" value="250.00" />$250.00</label></td>
<td><label><input type="checkbox" name="cleanup[]" value="150.00" />$150.00</label></td>
</tr>
<tr>
<td><label><input type="checkbox" name="lot[]" value="12" />12</label></td>
<td><label><input type="checkbox" name="plan[]" value="1A" />1A</label></td>
<td><label><input type="checkbox" name="yards[]" value="435" />435</label></td>
<td><label><input type="checkbox" name="scaffoldU[]" value="479" />479</label></td>
<td><label><input type="checkbox" name="lath[]" value="1,239.75" />$1,239.75</label></td>
<td><label><input type="checkbox" name="stone[]" value="" /> - </label></td>
<td><label><input type="checkbox" name="scratch[]" value="522.00" />$522.00</label></td>
<td><label><input type="checkbox" name="brown[]" value="783.00" />$783.00</label></td>
<td><label><input type="checkbox" name="foam[]" value="543.00" />$543.00</label></td>
<td><label><input type="checkbox" name="finish[]" value="652.50" />$652.50</label></td>
<td><label><input type="checkbox" name="prep[]" value="150.00" />$150.00</label></td>
<td><label><input type="checkbox" name="scaffoldD[]" value="261.00" />$261.00</label></td>
<td><label><input type="checkbox" name="cleanup[]" value="150.00" />$150.00</label></td>
</tr>
<tr>
<td><label><input type="checkbox" name="lot[]" value="16" />16</label></td>
<td><label><input type="checkbox" name="plan[]" value="2A" />2A</label></td>
<td><label><input type="checkbox" name="yards[]" value="445" />445</label></td>
<td><label><input type="checkbox" name="scaffoldU[]" value="490" />490</label></td>
<td><label><input type="checkbox" name="lath[]" value="1,268.25" />$1,268.25</label></td>
<td><label><input type="checkbox" name="stone[]" value="" /> - </label></td>
<td><label><input type="checkbox" name="scratch[]" value="534.00" />$534.00</label></td>
<td><label><input type="checkbox" name="brown[]" value="801.00" />$801.00</label></td>
<td><label><input type="checkbox" name="foam[]" value="568.00" />$568.00</label></td>
<td><label><input type="checkbox" name="finish[]" value="667.50" />$667.50</label></td>
<td><label><input type="checkbox" name="prep[]" value="150.00" />$150.00</label></td>
<td><label><input type="checkbox" name="scaffoldD[]" value="267.00" />$267.00</label></td>
<td><label><input type="checkbox" name="cleanup[]" value="150.00" />$150.00</label></td>
</tr>
<tr>
<td><label><input type="checkbox" name="lot[]" value="15" />15</label></td>
<td><label><input type="checkbox" name="plan[]" value="3C" />3C</label></td>
<td><label><input type="checkbox" name="yards[]" value="395" />395</label></td>
<td><label><input type="checkbox" name="scaffoldU[]" value="435" />435</label></td>
<td><label><input type="checkbox" name="lath[]" value="1,125.75" />$1,125.75</label></td>
<td><label><input type="checkbox" name="stone[]" value="1225.00" />$1225.00</label></td>
<td><label><input type="checkbox" name="scratch[]" value="474.00" />$474.00</label></td>
<td><label><input type="checkbox" name="brown[]" value="711.00" />$711.00</label></td>
<td><label><input type="checkbox" name="foam[]" value="660.00" />$660.00</label></td>
<td><label><input type="checkbox" name="finish[]" value="592.50" />$592.50</label></td>
<td><label><input type="checkbox" name="prep[]" value="150.00" />$150.00</label></td>
<td><label><input type="checkbox" name="scaffoldD[]" value="237.00" />$237.00</label></td>
<td><label><input type="checkbox" name="cleanup[]" value="150.00" />$150.00</label></td>
</tr>
</table>
Here is the PHP:
$lotnumbers = $_REQUEST['lots'];
$lathcosts = $_REQUEST['lath'];
$stonecosts = $_REQUEST['stone'];
$scratchcosts = $_REQUEST['scratch'];
$browncosts = $_REQUEST['brown'];
$foamcosts = $_REQUEST['foam'];
$finishcosts = $_REQUEST['finish'];
$prepcosts = $_REQUEST['prep'];
$scaffoldDcosts = $_REQUEST['scaffoldD'];
$cleanupcosts = $_REQUEST['cleanup'];
#foreach ($_POST['lots'] as $lotnumber) {
# $lotnumbers .= '' . $lotnumber . '<br />';
#}
#
#foreach ($_POST['lath'] as $lathcost) {
# $lathcosts .= '' . $lathcost . '<br />';
#}
#
#foreach ($_POST['stone'] as $stonecost) {
# $stonecosts .= '' . $stonecost . '<br />';
#}
#
#foreach ($_POST['scratch'] as $scratchcost) {
# $scratchcosts .= '' . $scratchcost . '<br />';
#}
#
#foreach ($_POST['brown'] as $browncost) {
# $browncosts .= "$browncost";
#}
#
#foreach ($_POST['foam'] as $foamcost) {
# $foamcosts .= "$foamcost";
#}
#
#foreach ($_POST['finish'] as $finishcost) {
# $finishcosts .= "$finishcost";
#}
#
#foreach ($_POST['prep'] as $prepcost) {
# $prepcosts .= "$prepcost";
#}
#
#foreach ($_POST['scaffoldD'] as $scaffoldDcost) {
# $scaffoldDcosts .= "$scaffoldDcost";
#}
#
#foreach ($_POST['cleanup'] as $cleanupcost) {
# $cleanupcosts .= "$cleanupcost";
#}
$table_output = '
<table>
<tr>
<td>Lot # -</td>
<td> Lath -</td>
<td> Stone -</td>
<td> Scratch -</td>
<td> Brown -</td>
<td> Foam -</td>
<td> Finish -</td>
<td> Prep -</td>
<td> Scaffold D -</td>
<td> Cleanup</td>
</tr>
<tr>
<td>' . $lotnumbers . '</td>
<td>' . $lathcosts . '</td>
<td>' . $stonecosts . '</td>
<td>' . $scratchcosts . '</td>
<td>' . $browncosts . '</td>
<td>' . $foamcosts . '</td>
<td>' . $finishcosts . '</td>
<td>' . $prepcosts . '</td>
<td>' . $scaffoldDcosts . '</td>
<td>' . $cleanupcosts . '</td>
</tr>
</table>
';
The foreach loops are commented out because I kept getting errors once I put more than one in the script.
Basically I want the email to display the table that was on the webpage, except with only the checked values, the rest of the spaces will be blank.