Simple contact form with field validation
You don’t have any validation mechanism. Your logic should be somewhat along those lines Submit form Check submitted fields ($_POST) against expected values If all looks good send If something is not as expected, log error ( you can use WP_Error() ) and rebuild form showing error message (and maybe repopulating fields with previous “good” … Read more