/* Check to make sure we are connected to the database before
allowing access to the home page. If not connected, go connect
and initialize; otherwise, welcome the user.\
*/
if(!database.connected())
redirect("init.htm");
/* The SQL statment to insert a new customer into the database is constructed
here based upon the values obtained from the form elements in "employer.html",
which are passed as properties of the REQUEST object. Notice how each value
is surrounded by single quotes, as specified by SQL syntax rules.
This operation could also have been performed by establishing a cursor
on the EMPLOYER table and performing and calling the "cursor.updateRow()" method.
*/
database.execute("insert into employer values ('" +
request.name + "'," +
request.id + "," +
request.control_no + "," +
request.suffix + "," +
request.account + "," +
request.plan_no + "," +
request.claim_office + "," +
request.customer + ",'" +
request.address + "','" +
request.city + "','" +
request.state + "','" +
request.zip + "','" +
request.phone + "','" +
request.admin + "','" +
request.email + "')")
redirect("employer.htm")