added as per qa

This commit is contained in:
2025-08-22 12:16:36 +05:45
parent 5fb284e4b6
commit c3514ab1d8
9 changed files with 64 additions and 51 deletions

View File

@@ -18,6 +18,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$subject = htmlspecialchars(trim($_POST['subject']));
$message = htmlspecialchars(trim($_POST['message']));
if (!preg_match('/^[0-9]{10}$/', $_POST['phone'])) {
$errors[] = "Please enter a valid 10-digit phone number.";
}
if (!empty($name) && !empty($user_email) && !empty($phone) && !empty($subject) && !empty($message) && !empty($address)) {
try {
// Send confirmation email to user