Để tạo một biểu mẫu HTML phức tạp, bạn có thể sử dụng các loại input khác nhau như sau:
```html
<form action="xu-ly-bieu-mau.php" method="post">
<label for="name">Họ và tên:</label>
<input type="text" id="name" name="name" required><br>
<label for="gender">Giới tính:</label>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Nam</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Nữ</label><br>
<label for="interests">Sở thích:</label>
<input type="checkbox" id="reading" name="interests[]" value="reading">
<label for="reading">Đọc sách</label>
<input type="checkbox" id="traveling" name="interests[]" value="traveling">
<label for="traveling">Du lịch</label><br>
<label for="country">Quốc gia:</label>
<select id="country" name="country">
<option value="vn">Việt Nam</option>
<option value="us">Mỹ</option>
<option value="jp">Nhật Bản</option>
</select><br>
<input type="submit" value="Gửi">
</form>
```
### Cách xử lý dữ liệu:
Khi người dùng gửi biểu mẫu, dữ liệu sẽ được gửi đến tệp `xu-ly-bieu-mau.php` thông qua phương thức POST. Trong tệp PHP, bạn có thể xử lý dữ liệu như sau:
```php
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST['name'];
$gender = $_POST['gender'];
$interests = isset($_POST['interests']) ? $_POST['interests'] : [];
$country = $_POST['country'];
// Xử lý dữ liệu (lưu vào cơ sở dữ liệu, gửi email, v.v.)
}
?>
```
### Tóm lại:
Biểu mẫu này bao gồm các loại input khác nhau và xử lý dữ liệu bằng PHP, cho phép bạn thu thập thông tin từ người dùng một cách hiệu quả.