Added functionality to insert form data into a database