<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Checklist</title>
</head>
<body>
    
<br>
<a href="../coding/coding_main.php" title="Lihat Keuangan Hari ini"><button style="padding : 10px; width:100%; background-color:#546E7A;">CODING</button></a>
<br>
<br>
    
    <form method="post" action="">
        <label>
            <input type="checkbox" name="checklist[]" value="item1"> Item 1
        </label><br>
        <label>
            <input type="checkbox" name="checklist[]" value="item2"> Item 2
        </label><br>
        <label>
            <input type="checkbox" name="checklist[]" value="item3"> Item 3
        </label><br>
        <label>
            <input type="checkbox" name="checklist[]" value="item4"> Item 4
        </label><br>
        <input type="submit" name="submit" value="Submit">
    </form>

    <?php
    if (isset($_POST['submit'])) {
        if (!empty($_POST['checklist'])) {
            echo "You have selected: <br>";
            foreach ($_POST['checklist'] as $selected) {
                echo $selected . "<br>";
            }
        } else {
            echo "No items selected.";
        }
    }
    ?>
</body>
</html>
