AHA! I can only use one $body value.
I got around the problem using an array:
Code:
<?php
$to = "myemailaddy@mail.co.uk" ;
$name = $_REQUEST['name'] ;
$headers = $_REQUEST['Email'] ;
$subject = "Repair Request Form";
$fields = array();
$fields{"name"} = "Tenant Name";
$fields{"houseNumber"} = "House Name";
$fields{"address1"} = "Address Line 1";
$fields{"address2"} = "Address Line 2";
$fields{"address3"} = "Address Line 3";
$fields{"postcode"} = "Postcode";
$fields{"optone"} = "Type of Repair";
$fields{"opttwo"} = "Problem";
$fields{"details"} = "Details of Problem";
$fields{"email"} = "E-mail Address";
$fields{"dayphone"} = "Daytime Telephone Number";
$fields{"evephone"} = "Evening Telephone Number";
$fields{"mobphone"} = "Mobile Telephone Number";
$fields{"mondayam"} = "Monday AM Repair";
$fields{"tuesdaypm"} = "Tuesday PM Repair";
$fields{"wednesdaypm"} = "Wednesday PM Repair";
$fields{"thursdayam"} = "Thursday AM Repair";
$fields{"fridayam"} = "Friday AM Repair";
$fields{"accessarrangements"} = "Access Arrangements";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$send = mail($to, $subject, $body, $headers);
?>
This e-mails me the info. Mostly 
Unfortunately, my drop-down menu boxes aren't really working. I'm using the following code, anyone want to help me out here? 'optone' returns the numerical value, and 'opttwo' is blank.
Code:
<select name="optone" size="1"
onchange="setOptions(document.myform.optone.options
[document.myform.optone.selectedIndex].value);">
<option value=" " selected="selected">Select Problem Area</option>
<option value="1">Windows</option>
<option value="2">Doors</option>
<option value="3">Roof & Guttering</option>
<option value="4">Heating & Hot Water</option>
<option value="5">Electrical</option>
<option value="6">Plumbing - Bathroom</option>
<option value="7">Plumbing - Kitchen</option>
<option value="8">Kitchen</option>
<option value="9">Internal Structural</option>
<option value="10">External Areas</option>
<option value="11">Communal Areas</option>
</select>
<br>
<br>
<select name="opttwo" size="1">
<option value=" " selected="selected">Please select one of the options above first</option>
</select>
I'm not going to add in the code for 'opttwo', because it's HUGE. Imagine another 250 line of the following:
Code:
function setOptions(chosen) {
var selbox = document.myform.opttwo;
selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Please select one of the options above first',' ');
}
if (chosen == "1") {
selbox.options[selbox.options.length] = new
Option('Broken Glass','broken glass');
selbox.options[selbox.options.length] = new
Option('Damaged Handle','damaged handle');
selbox.options[selbox.options.length] = new
Option('Broken Catch','broken catch');
selbox.options[selbox.options.length] = new
Option('Damaged Seal','damaged seal');
Bookmarks