Note that there are some explanatory texts on larger screens.

plurals
  1. POStruggling with PHP form processing
    primarykey
    data
    text
    <p>Can anyone help with a form problem that I just can't fathom? I have a group of checkboxes whose values I can't get to show up in the resulting mail.</p> <p>This is the method I'm using to set the variables:</p> <pre><code> $benefit01 = ($_POST['benefit_01']); $benefit02 = ($_POST['benefit_02']); $benefit03 = ($_POST['benefit_03']); $benefit04 = ($_POST['benefit_04']); $benefit05 = ($_POST['benefit_05']); $benefit06 = ($_POST['benefit_06']); $property = addslashes($_POST['property']); $owner = addslashes($_POST['owner']); $mainHeating = addslashes($_POST['Heating_mainHeating_answer']); $boiler_working = addslashes($_POST['boiler_working']); $boiler_age = addslashes($_POST['boiler_age']); $postcode = addslashes($_POST['postcode']); $address1 = addslashes($_POST['address1']); $address2 = addslashes($_POST['address2']); $address3 = addslashes($_POST['address3']); $city = addslashes($_POST['town']); $county = addslashes($_POST['county']); $name = addslashes($_POST['firstName']); $surname = addslashes($_POST['surname']); $email = addslashes($_POST['email']); $phone = addslashes($_POST['phonenum']); $type = addslashes($_POST['type']); $time = $_POST['time']; $src = $_POST['urlsrc'] ; $benefits = $benefit01." ".$benefit02." ".$benefit03." ".$benefit04." ".$benefit05." ".$benefit06; $address = $address1." ".$address2; $note = "Benefits: ".$benefits.". Property Type: ".$property.". Home Owner: ".$owner.". Type of Heating: ".$mainHeating.". Boiler Working: ".$boiler_working.". Boiler Age: ".$boiler_age.". Timescales: ".$time.". Address Line 3: ".$address3; </code></pre> <p>So the "benefits" are checkboxes. I had tried naming them all the same to create an array then imploding the values but that didn't work either. Ultimately this data is sent to a dbase which is why most of the info is dumped into a $note variable.</p> <p>I don't know much about this and have taken this example from a working (albeit simplified) form. Any assistance appreciated.</p> <p>** Small sample of the form added below:</p> <pre><code> &lt;input name="ctl00_chkBenefit" type="checkbox" id="benefit_01" class="checkbox-benefit" value="Child Tax Credit" /&gt; </code></pre> <p>Child Tax Credit (where the relevant income is £15,860 or less)</p> <pre><code> &lt;input name="ctl01_chkBenefit" type="checkbox" id="benefit_02" class="checkbox-benefit" value="State Pension Credit" /&gt; </code></pre> <p>State Pension Credit</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload