<!DOCTYPE html>
<html lang="vi">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {
            padding: 0;
        }
    </style>
</head>

<body>
    Bài 1:
    <form action="hello.php" method="post">
        <label>Họ tên: </label>
        <input type="text" name="name">
        <button type="submit">Submit</button>
    </form>

    <br><br>Bài 2:
    <form action="./" method="get">
        <input type="text" name="keyword" placeholder="Từ khóa...">
        <button type="submit">Tìm</button>
    </form>
    <?php
    $keyword = isset($_GET['keyword']);
    if ($keyword) echo "Kết quả tìm kiếm với từ khoá " . $_GET['keyword'];
    ?>

    <br><br>Bài 3:
    <?php
    $name = isset($_GET['name']) ? $_GET['name'] : "";
    $email = isset($_GET['email']) ? $_GET['email'] : "";
    $website = isset($_GET['website']) ? $_GET['website'] : "";
    $comment = isset($_GET['comment']) ? $_GET['comment'] : "";
    $gender = isset($_GET['gender']) ? $_GET['gender'] : "";
    ?>
    <form action="./" method="get">
        <div>
            <label>Name: </label>
            <input type="text" name="name" value=<?php echo $name ?>>
        </div>
        <div>
            <label>Email: </label>
            <input type="email" name="email" value=<?php echo $email ?>>
        </div>
        <div>
            <label>Website: </label>
            <input type="text" name="website" value=<?php echo $website ?>>
        </div>
        <div>
            <label>Comment: </label>
            <textarea name="comment" cols="30" rows="10"><?php echo $comment ?></textarea>
        </div>
        <div>
            <label>Gender: </label>
            <input type="radio" name="gender" value="1" <?php echo $gender == "1" ? "checked" : null ?>> Female
            <input type="radio" name="gender" value="2" <?php echo $gender == "2" ? "checked" : null ?>> Male
        </div>
        <button type="submit">Submit</button>
    </form>
    Name: <?php echo $name ?><br>
    Email: <?php echo $email ?><br>
    Website: <?php echo $website ?><br>
    Comment: <?php echo $comment ?><br>
    Gender: <?php if ($gender) echo $gender == "2" ? "Male" : "Female" ?><br>


    <br><br>Bài 4:<br>
    <form action="menu.php" method="post">
        <div style="display: flex; justify-content: space-around;">
            <div>
                <label>Món khai vị: </label><br>
                <select multiple name="khaivi[]" id="">
                    <option>Gỏi ngó sen</option>
                    <option>Salat cá ngữ</option>
                    <option>Bò trộn rau thơm</option>
                    <option>Thịt nguội</option>
                </select>
            </div>
            <div>
                <label>Món chính: </label><br>
                <select multiple name="monchinh[]" id="">
                    <option>Bò hầm</option>
                    <option>Cá chẽm sốt cà</option>
                    <option>Tôm rang muối</option>
                    <option>Cua sốt me</option>
                </select>
            </div>
            <div>
                <label>Món tráng miệng: </label><br>
                <select multiple name="trangmieng[]" id="">
                    <option>Chè hạt sen</option>
                    <option>Bánh plan</option>
                    <option>Rau câu</option>
                </select>
            </div>
        </div>
        <br>
        <div style="text-align: center;">
            <button type="submit">Submit</button>
        </div>
    </form>
</body>

</html>