Refactor form in index.php (use ternary operator).
Refactor validation check for empty fields.