protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html");
		HttpSession session = request.getSession(true);
		String id = request.getParameter("driverId");
		String pwd = request.getParameter("driverPwd");
		PrintWriter pw = response.getWriter();
		AdminQuery aq = new AdminQuery();
		String pg = "";

		System.out.println("ID=|"+id+"|Pwd=|"+pwd);
		if (id == null || pwd == null)
		{
			pg += "<div class='register_box'><div id='panel'>";
			pg += "<form id='driverLogin' action='DriverLogin' method='post' accept-charset='UTF-8'>" +
					"<fieldset >" +
					"<legend>Delivery Driver Login</legend>" + 
					"<input type='hidden' name='submitted' id='submitted' value='1'/>" +
					"<div id='row'><label for='driverId' >Login ID: </label>" +
					"<input type='text' name='driverId' id='driverID' maxlength=\"25\" /></div>" +
					"<div id='row'><label for='driverPwd' >Password: </label>" +
					"<input type='password' name='driverPwd' id='driverPwd' maxlength=\"25\" /></div>" +
					"<center><div id='row'><input type='submit' name='driverSubmit' value='Log on' /></div></center>" +
					"</fieldset>" +
					"</form></div></div>";
		}		
		else if (id != null && pwd != null && id.length() > 0 && pwd.length() > 0)
		{
			//both fields were entered, so lookup driver id in database.
//			Integer driverID = Integer.parseInt(id.trim());
			id = id.trim();
			pwd = pwd.trim();
			String driverQuery = "select password from deliverypersons where deliv_id = "+id;
			ResultSet driverRes = aq.executeQuery(driverQuery);
			try {
				if (driverRes.next())
				{
					//a password was retrieved from the DB
					String dbPwd = driverRes.getString(1).trim();
					if (dbPwd.equals(pwd))
					{
						//Login information is correct--
						session.setAttribute("driverName", id);
						session.setAttribute("Pwd", pwd);
						pg += getDelivery(id);
//						//Complete Delivery Button--Process payment
//						pg  += "</div><form id='completeOrder' action='Driver' method='post' accept-charset='UTF-8'>" +
//							     "<center><div id='row'><input type='submit' name='complete' value='Process Payment' /></center>"+
//								"</form>";
						pg += "</div><form id='logout' action='Driver' method='post' accept-charset='UTF-8'>" +
							     "<center><div id='row'><input type='submit' name='driverLogout' value='Log out' /></center>"+
								"</form>";
					}
					else
					{
						pg += "<div class='register_box'><div id='err'>Invalid Login Information</div><div id='panel'>";
						pg += "<form id='driverLogin' action='DriverLogin' method='post' accept-charset='UTF-8'>" +
								"<fieldset >" +
								"<legend>Delivery Driver Login</legend>" + 
								"<input type='hidden' name='submitted' id='submitted' value='1'/>" +
								"<div id='row'><label for='driverId' >Login ID: </label>" +
								"<input type='text' name='driverId' id='driverID' maxlength=\"25\" /></div>" +
								"<div id='row'><label for='driverPwd' >Password: </label>" +
								"<input type='password' name='driverPwd' id='driverPwd' maxlength=\"25\" /></div>" +
								"<center><div id='row'><input type='submit' name='driverSubmit' value='Log on' /></div></center>" +
								"</fieldset>" +
								"</form></div></div>";
					}
				}
				else
				{
					//invalid login information
					pg += "<div class='register_box'><div id='err'>Invalid Login Information</div><div id='panel'>";
					pg += "<form id='driverLogin' action='DriverLogin' method='post' accept-charset='UTF-8'>" +
							"<fieldset >" +
							"<legend>Delivery Driver Login</legend>" + 
							"<input type='hidden' name='submitted' id='submitted' value='1'/>" +
							"<div id='row'><label for='driverId' >Login ID: </label>" +
							"<input type='text' name='driverId' id='driverID' maxlength=\"25\" /></div>" +
							"<div id='row'><label for='driverPwd' >Password: </label>" +
							"<input type='password' name='driverPwd' id='driverPwd' maxlength=\"25\" /></div>" +
							"<center><div id='row'><input type='submit' name='driverSubmit' value='Log on' /></div></center>" +
							"</fieldset>" +
							"</form></div></div>";
				}				
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		else
		{		
			//at least one of the fields is empty
			pg += "<div class='register_box'><div id='err'>Invalid Login Information</div><div id='panel'>";
			pg += "<form id='driverLogin' action='DriverLogin' method='post' accept-charset='UTF-8'>" +
					"<fieldset >" +
					"<legend>Delivery Driver Login</legend>" + 
					"<input type='hidden' name='submitted' id='submitted' value='1'/>" +
					"<div id='row'><label for='driverId' >Login ID: </label>" +
					"<input type='text' name='driverId' id='driverID' maxlength=\"25\" /></div>" +
					"<div id='row'><label for='driverPwd' >Password: </label>" +
					"<input type='password' name='driverPwd' id='driverPwd' maxlength=\"25\" /></div>" +
					"<center><div id='row'><input type='submit' name='driverSubmit' value='Log on' /></div></center>" +
					"</fieldset>" +
					"</form></div></div>";
		}
		writePage(pg, pw);
	}