using html template; sql query used as it should on GET; sql insert used on POST