I have made a mail form like so
<?php
//session_start();
$Total = $_POST['Total'];
$room = $_POST['room'];
$letter = $_POST['letter'];
$Name = $_POST['name'];
$Email = $_POST['email'];
$Address = $_POST['address'];
$Message = $_POST['message'];
$body = "Message sent from CARBONYZED Quotation System | www.CARBONYZED.co.uk ". "\r\n".
"// Number of $room = Sel". $letter. " \r\n".
"// Quote Total = ". $Total. " \r\n".
"// Name = ". $Name. " \r\n".
"// Email = ". $Email. " \r\n".
"// Address = ". $Address. " \r\n".
"// Message = ". $Message. " \r\n".
$subject = "**CONTACT FORM** - From CARBONYZED's Web Server";
$to = "AffordableCleaners@carbonyzed.co.uk";
$headers = 'AffordableCleaners@carbonyzed.co.uk' . "\r\n" .
'Reply-To: AffordableCleaners@carbonyzed.co.uk' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if (mail($to, $Email, $body, $headers)) {
echo("<p>Message successfully sent!</p> Click here to go <a href='http://www.affordablecleaners.co.uk'>back</a>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
Which is great except I need to add some more functions. On the previous Page, I have a number of boxes, which I will post here
<tr>
<td align="left">Stairs</td>
<td align="center" style="text-align: left">
<select name="SelA">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<input type="hidden" name="TotA" onFocus="this.blur();" />
<br></td>
<td width="120" align="center" style="text-align: left">
<select name="SelAA">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<input type="hidden" name="TotAA" onFocus="this.blur();" />
<br></td>
<td width="116" align="center" style="text-align: left">
<select name="SelUA">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<input type="hidden" name="TotUA" onFocus="this.blur();" />
<br></td>
</tr>
Please can you help me do two things, firstly pull forward the Stairs to send the content (e.g. Stairs) with the mail but also 3 values, the content for each of the in each of the drop downs…
Also, we may be adding a number of all with similar data, but not identical. basically the name text value in th Stairs format will allways be random but the SelA and SelUA will always be changing. Basically we would need it to loop for everything between and pulling in these 4 bits of info (or 8, 12, 16…
Hope somebody’s crazy brain can help
Regards
Henry
Every form option from the previous page before the submit (whether it be POST or GET) will be included as it’s name on the next page. Just like the statements at the top of your PHP, you can get the values of your boxes:
Then you can just use these values in the body like you already have:
Is that what you are looking for?