I am getting these errors when trying to add information to the database. It doesn't add anything into the database. Can someone please look at this and give me some help. Thanks
Notice: Undefined index: employee in /var/www/html/Metrics/AddMetrics.php on line 52
Notice: Undefined index: LastName in /var/www/html/Metrics/AddMetrics.php on line 53
Notice: Undefined index: FirstName in /var/www/html/Metrics/AddMetrics.php on line 54
Notice: Undefined index: Shift in /var/www/html/Metrics/AddMetrics.php on line 55
Notice: Undefined index: Month in /var/www/html/Metrics/AddMetrics.php on line 56
Notice: Undefined index: Day in /var/www/html/Metrics/AddMetrics.php on line 57
Notice: Undefined index: Year in /var/www/html/Metrics/AddMetrics.php on line 58
Notice: Undefined index: operation in /var/www/html/Metrics/AddMetrics.php on line 61
Notice: Undefined index: machine in /var/www/html/Metrics/AddMetrics.php on line 62
Notice: Undefined index: sku in /var/www/html/Metrics/AddMetrics.php on line 63
Notice: Undefined index: scrap in /var/www/html/Metrics/AddMetrics.php on line 64
Notice: Undefined index: scrapcode in /var/www/html/Metrics/AddMetrics.php on line 65
Notice: Undefined index: downtime in /var/www/html/Metrics/AddMetrics.php on line 66
Notice: Undefined index: downtimecode in /var/www/html/Metrics/AddMetrics.php on line 67
Here is my code:
MetricsDataBaseAdd.php
<form action="AddMetrics.php" method="post">
<h4> Please Select a DS Dental Employee: </h4>
<select name = "Emp_Id">
<option value=" ">Select Employee</option>
<option value="1">John Doe</option>
<option value="2">Jane Doe</option>
</select>
</form>
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a FIRST NAME: <input type="text" STYLE= "background-color: #c0c0c0;" name="FirstName" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a LAST NAME: <input type="text" STYLE= "background-color: #c0c0c0;" name="LastName" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a SHIFT: <input type="text" STYLE= "background-color: #c0c0c0;" name="Shift" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a MONTH: <input type="text" STYLE= "background-color: #c0c0c0;" name="Month" /> example 01
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a DAY: <input type="text" STYLE= "background-color: #c0c0c0;" name="Day" /> example 01
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a YEAR: <input type="text" STYLE= "background-color: #c0c0c0;" name="Year" /> example 2010
<br>
<br>
<br>
<h2 align="center"><u><strong><font face="arial">Add New Operation Information</font></strong></u></h2>
<br>
<form action="AddMetrics.php" method="post">
Please enter a OPERATION: <input type="text" STYLE= "background-color: #c0c0c0;" name="operation" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a MACHINE: <input type="text" STYLE= "background-color: #c0c0c0;" name="machine" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a SKU #: <input type="text" STYLE= "background-color: #c0c0c0;" name="sku" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter SCRAP: <input type="text" STYLE= "background-color: #c0c0c0;" name="scrap" />
<br>
<br>
<form action="AddMetrics.php" method="post">
<h4> Please Select a Scrap Code: </h4>
<select name = "scrapcode">
<option value=" ">Select Scrap Code</option>
<option value="Bent">1-Bent</option>
<option value="Chamfer">2-Chamfer</option>
</select>
</form>
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter DOWNTIME: <input type="text" STYLE= "background-color: #c0c0c0;" name="downtime" /> in minutes
<br>
<br>
<form action="AddMetrics.php" method="post">
<h4> Please Select a Machining Downtime Code: </h4>
<select name = "downtimecode">
<option value=" ">Select Downtime Code</option>
<option value="Setup">1-Setup</option>
<option value="Re-Setup">2-Re-Setup</option>
<option value="Misc">10-Misc</option>
</select>
</form>
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a TIME PER OPERATION: <input type="text" STYLE= "background-color: #c0c0c0;" name="timeperop" /> in minutes
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter a OUTPUT: <input type="text" STYLE= "background-color: #c0c0c0;" name="output" />
<br>
<br>
<br>
<h2 align="center"><u><strong><font face="arial">Add New Metrics Totals</font></strong></u></h2>
<br>
<form action="AddMetrics.php" method="post">
Please enter TOTAL SCRAP: <input type="text" STYLE= "background-color: #c0c0c0;" name="totalscrap" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter TOTAL DOWNTIME: <input type="text" STYLE= "background-color: #c0c0c0;" name="totaldowntime" /> in minutes
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter TOTAL PIECES: <input type="text" STYLE= "background-color: #c0c0c0;" name="totalpieces" />
<br>
<br>
<form action="AddMetrics.php" method="post">
Please enter TOTAL HOURS: <input type="text" STYLE= "background-color: #c0c0c0;" name="totalhours" />
<br>
<br>
<br>
<br>
<center><input type="submit" value="Add Metrics Information"></center>
</form>
AddMetrics.php
<?php
$con = mysql_connect("localhost","user","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("metrics_db", $con);
// Employee Data Variables
$Emp_Id = $_POST['Emp_Id'];
$LastName = $_POST['LastName'];
$FirstName = $_POST['FirstName'];
$Shift = $_POST['Shift'];
$Month = $_POST['Month'];
$Day = $_POST['Day'];
$Year = $_POST['Year'];
// Metrics Data Variables
$operation = $_POST['operation'];
$machine = $_POST['machine'];
$sku = $_POST['sku'];
$scrap = $_POST['scrap'];
$scrapcode = $_POST['scrapcode'];
$downtime = $_POST['downtime'];
$downtimecode = $_POST['downtimecode'];
$timeperop = $_POST['timeperop'];
$output = $_POST['output'];
// Totals Data Variables
$totalscrap = $_POST['totalscrap'];
$totaldowntime = $_POST['totaldowntime'];
$totalpieces = $_POST['totalpieces'];
$totalhours = $_POST['totalhours'];
// Insert Data Into Database
mysql_query("INSERT INTO employee(Emp_Id,
LastName,
FirstName,
Shift,
Month,
Day,
Year
)
VALUES('$Emp_Id',
'$LastName',
'$FirstName',
'$Shift',
'$Month',
'$Day',
'$Year'
)");
mysql_query("INSERT INTO metrics(Emp_Id,
Month,
Day,
Year,
operation,
machine,
sku,
scrap,
scrapcode,
downtime,
downtimecode,
timeperop,
output
)
VALUES('$Emp_Id',
'$Month',
'$Day',
'$Year',
'$operation',
'$machine',
'$sku',
'$scrap',
'$scrapcode',
'$downtime',
'$downtimecode',
'$timeperop',
'$output'
)");
mysql_query("INSERT INTO totals(Emp_Id,
Month,
Day,
Year,
totalscrap,
totaldowntime,
totalpieces,
totalhours
)
VALUES('$Emp_Id',
'$Month',
'$Day',
'$Year',
'$totalscrap',
'$totaldowntime',
'$totalpieces',
'$totalhours'
)");
mysql_close($con);
?>
<h3 align="center"><u><strong><font face="arial"><?php echo $FirstName." ".$LastName;
?> Daily Production Has Been Added to Database</font></strong></u></h3>