HTML code: (done in frontpage)
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="Microsoft Theme" content="arctic 111, default">
</head>
<body>
<form action = "handleenterwork.php" method = "post">
<form method="POST" action="--WEBBOT-SELF--" onSubmit="location.href='derived/nortbots.htm';return false;" webbot-onSubmit>
<!--webbot bot="SaveResults" u-file="private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" --><fieldset style="padding: 2; width:985; height:350">
<legend>Group box</legend>
<p style="margin-top: 0; margin-bottom: 0">
<p style="margin-top: 0; margin-bottom: 0">
Date:
<input type="text" name="date" size="16" tabindex="1">
Day: <input type="radio" value="Monday" name="day" tabindex="2">M
<input type="radio" name="day" value="Tuesday" tabindex="3">T
<input type="radio" name="day" value="Wednesday" tabindex="4">W
<input type="radio" name="day" value="Thursday" tabindex="5">R
<input type="radio" name="day" value="Friday" tabindex="6">F
<input type="radio" name="day" value="Saturday" tabindex="7">S </p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0">Employee:
<select size="1" name="employee" tabindex="8">
<option>Campbell, Mike</option>
<option>Jaworski, Dave</option>
<option>Suffern, Bill</option>
<option>Suffern, Jim</option>
</select> Plan:
<select size="1" name="plan" tabindex="9">
<option>Beechwood</option>
<option>Brookfield</option>
<option>Neville Manor</option>
<option>Woodlands</option>
<option>Willowbrook</option>
<option>Walnut Ridge</option>
</select> Lot:
<select size="1" name="lot" tabindex="10">
<option>100</option>
<option>200</option>
<option>300</option>
<option>400</option>
<option>500</option>
</select> </p>
<p> </p>
<p>Foundation Work:</p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="75%" height="58">
<tr>
<td width="36%" height="58">Type of House:
<select size="1" name="house">
<option>Two Story</option>
<option>Ranch</option>
</select></td>
<td width="64%" height="58"><p style="margin-top: 0; margin-bottom: 0">
Garage:
<input type="radio" name="garage" value="Integral Front" checked>Integral Front
<input type="radio" name="garage" value="Attached">Attached</p>
<p style="margin-top: 0; margin-bottom: 0">
<input type="radio" name="garage" value="Integral Side">Integral Side</p>
<p style="margin-top: 0; margin-bottom: 0">
<input type="radio" name="garage" value="Integral Rear">Integral Rear</p>
</td>
</tr>
</table><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="585">
<tr>
<td width="278" align="center">
<p style="margin-top: 0; margin-bottom: 0"><font face="Arial"><b>Work
Completed</b></font></td>
<td width="112" align="center">
<p style="margin-top: 0; margin-bottom: 0"><font face="Arial"><b>Machine</b></font></td>
<td width="54" align="center">
<p style="margin-top: 0; margin-bottom: 0"><font face="Arial"><b>Truck</b></font></td>
<td width="141" align="center">
<p style="margin-top: 0; margin-bottom: 0"><font face="Arial"><b>Hours</b></font></td>
</tr>
<tr>
<td width="278" bgcolor="#CAD8D9">
<input type="checkbox" name="work[]" value="Dig Foundation">Dig Foundation</td>
<td width="112" bgcolor="#CAD8D9">
<p align="center"><select size="1" name="machine[]">
<option>Highlift</option>
<option>Backhoe</option>
<option>Excavator</option>
<option>Bobcat</option>
<option>Takeuchi</option>
</select></td>
<td width="54" bgcolor="#CAD8D9">
<p align="center"><input type="checkbox" name="truck[]" value="ON"></td>
<td width="141" bgcolor="#CAD8D9">
<p align="center"><input type="text" name="hours[]" size="13"></td>
</tr>
<tr>
<td width="278">
<input type="checkbox" name="work[]" value="Fill/Cut Down Lot">Fill/Cut Down
Lot</td>
<td width="112" align="center"><select size="1" name="machine[]">
<option>Highlift</option>
<option>Backhoe</option>
<option>Excavator</option>
<option>Bobcat</option>
<option>Takeuchi</option>
</select></td>
<td width="54" align="center">
<input type="checkbox" name="truck[]" value="ON"></td>
<td width="141" align="center">
<input type="text" name="hours[]" size="13"></td>
</tr>
<tr>
<td width="278" bgcolor="#CAD8D9">
<input type="checkbox" name="work[]" value="Push Fill at Dumpsite">Push Fill at Dumpsite</td>
<td width="112" align="center" bgcolor="#CAD8D9">
<select size="1" name="machine[]">
<option>Highlift</option>
<option>Backhoe</option>
<option>Excavator</option>
<option>Bobcat</option>
<option>Takeuchi</option>
</select></td>
<td width="54" align="center" bgcolor="#CAD8D9">
<input type="checkbox" name="truck[]" value="ON"></td>
<td width="141" align="center" bgcolor="#CAD8D9">
<input type="text" name="hours[]" size="13"></td>
</tr>
</table>
<p> </p>
<p> </p>
</fieldset><p> </p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</font></font></body>
</html>
php code (so far). Right now, it just overwrites with the last text box checked. I don't know how to do the array:
$self= $SERVER['PHP_SELF'];
$date= $POST['date'];
$day= $POST['day'];
$employee= $POST['employee'];
$plan= $POST['plan'];
$lot= $POST['lot'];
$house= $POST['house'];
$garage= $POST['garage'];
$work= $POST['work'];
$machine= $POST['machine'];
$truck= $POST['truck'];
$hours= $POST['hours'];
#ensure values exist
if( $date and $day and $employee and $plan and $lot )
{
#connect to mysql
$conn=@mysql_connect( "localhost", "root", "password" )
or die( "Error connecting to MySQL" );
#select specified database
$rs = @mysql_select_db( "sap", $conn )
or die( "Error connecting to db" );
#create the query
$sql="insert into jobs (date, day, employee, plan, lot, house, garage, work, machine, truck, hours)
values ( \"$date\", \"$day\", \"$employee\", \"$plan\", \"$lot\", \"$house\", \"$garage\", \"$work\", \"$machine\", \"$truck\", \"$hours\")"
or die( "Could not create query" );
#execute query
$rs = mysql_query( $sql, $conn )
or die( "Could not execute query" );
}
else
{ $msg="You did not enter all of the required fields.";
}
?>
<html><head><title>Form Error</title></head>
<body><h2> <?php echo($msg); ?> </h2><p><a href="test1.htm">Back to Create Bill Page</p>
<?body>
</html>