Hi all, I am trying to create a simple form which will eventually store the inputted values in a database and tracks data for travelling health professionals. The form looks OK to me but it does not appear to storing values for mileages and bonus but is working ok for the date and clinic. I have been over the code about 20 times but Im obviously missing something. Hoping it is just a silly typo!
[code]
Simple HTML Form label { font-weight: bold; color: #300ACC; } Please enter information in the form below:<p><label>Date: <input type="date" name="Date"/></label></p>
<p><label>Clinic: <input type="text" name="Clinic" size ="20" maxlength="30"/></label></p>
<p><label>Google Miles: <input type="number" name="Claimed Mileage" min="0" max="500"/></label></p>
<p><label>Actual Miles: <input type="number" name="Actual Mileage" min="0" max="500"/></label></p>
<p><label>Appointments: <input type="number" name="Appointments seen" min="0" max="7" /></label></p>
<p><label>Comments: <textarea name="Comments" rows="3" cols="40"></textarea></label></p>
</fieldset>
<p align="center"><input type="submit" name="submit" value="Submit" /></p>
<?php
$day = $_REQUEST['Date'];
$clinic = $_REQUEST['Clinic'];
$google = $_REQUEST['Claimed Mileage'];
$actual = $_REQUEST['Actual Mileage'];
$num_apps = $_REQUEST['Appointments seen'];
$comments = $REQUEST['Comments'];
$bonus = 0;
$diff = $actual - $google;
//Conditional Statements
if (num_apps == 5){
$bonus = 20;
}
elseif (num_apps == 6){
$bonus = 60;
}
elseif (num_apps == 7){
$bonus = 100;
}else{
$bonus = NULL;
}
if (isset($_REQUEST['Date'])) {
$day = $_REQUEST['Date'];
} else {
$day = NULL;
}
if (isset($_REQUEST['Clinic'])) {
$clinic = $_REQUEST['Clinic'];
} else {
$clinic = NULL;
}
if (isset($_REQUEST['Claimed Mileage'])) {
$google = $_REQUEST['Claimed Mileage'];
} else {
$google = NULL;
}
if (isset($_REQUEST['Actual Mileage'])) {
$actual = $_REQUEST['Actual Mileage'];
} else {
$actual = NULL;
}
if (isset($_REQUEST['Appointments seen'])) {
$num_apps = $_REQUEST['Appointments seen'];
} else {
$num_apps = NULL;
}
if(isset($_POST['submit'])) {
echo "Date: $dayClinic: $clinic
Claimed Mileage: $google
Actual Mileage: $actual
Mileage Difference: $diff
Bonus today: $bonus"; } ?> [/code] Any help greatly appreciated!