/* 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"); if (request.pin != request.pin2) { redirect("nomatch.htm"); } client.ssn = request.ssn; client.pin = request.pin; client.id = request.id; database.execute("insert INTO employee (ssn, pin, name, employer_id) values ( " + client.ssn + ", '" + client.pin + "', '" + request.userName + "', " + client.id + ")"); if (database.majorErrorCode() != 0) { redirect("error.htm"); } database.execute("insert into status (employee_ssn) values ( " + client.ssn + ")"); redirect("mainmenu.htm");