Insert and select data from a database, validate user inputs and send email using PHP scripting.