if(isset($_POST['submit'])){//If the form was submitted
//do this
}
else{ //the form hasnt been submitted so we show the form
echo ''; //end the echo
} //end the else
?>
if(isset($_POST['submit'])){//If the form was submitted
$name = $_POST['name']; //get the name
$query = $_POST['query']; //get the query
$output = '
Name: $name
Query: $query';
$mail = mail('steve@faberfamily.org.uk','Test email',$output); //mail it
echo 'You're email has been sent! congrats, you've completed you're first email form.';
}
else{ //the form hasent been submitted so we show the form
echo ''; //end the echo
} //end the else
?>