A form sends data to a PHP script with method="post". The script reads it from $_POST.
Validation checklist
- Check that required fields are not empty.
- Validate formats with
filter_var($email, FILTER_VALIDATE_EMAIL). - Clean input with
trim(). - Escape output with
htmlspecialchars()to prevent XSS. - Protect forms with a CSRF token (frameworks like Laravel do this for you).