SOURCE CODE:- <!DOCTYPE html> <html> <style> .error{ color:red; } body { font-family:arial; } </style> <body> <form method="post" action="<?php echo ($_SERVER["PHP_SELF"]);?>"> <!-- ($_SERVER["PHP_SELF"]) will return the filename of the currently executing script.--> <?php $name = $email = $gender = $address =$dob = ""; $nameError=$genderError=$emailError=""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameError = "Name is required"; //Error if name is empty } else { $name = ($_POST["name"]); if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameError = "Only letters and white space allowed"; //Error if name contains characters other than letters and white space. } } $dob = ($_POST["dob"]); ...