An Example “Contact Us” form using PHP with a Bootstrap frontend. The code has both PHP AND Javascript validation of the form.
You would need to manually comment out the Javascript code to see how the PHP validation performed. Note: This is using Bootstrap 4 BETA version.
The form itself is quite neat and elegant to code. Messages are close-able.