Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.8 kB
2
Indexable
Never
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>b</title>
</head>

<body>
    <?php
    if (isset($_POST['day'])) {

        $q = $_POST['day'];
        switch ($q) {
            case "monday":
                echo "Laugh on Monday, laugh for danger.";
                break;
            case "tuesday":
                echo "Laugh on Tuesday, kiss a stranger.";
                break;
            case "wednesday":
                echo "Laugh on Wednesday, laugh for a letter.";
                break;
            case "thursday":
                echo "Laugh on Thursday, something better.";
                break;
            case "friday":
                echo "Laugh on Friday, laugh for sorrow.";
                break;
            case "saturday":
                echo "Laugh on Saturday, joy tomorrow.";
                break;
            default:
                echo "invalid input!";
                break;
        } ?>
    <a href="b.php"><button>Go</button></a>

    <?php
    } else {
    ?>

    <form method="post">
        <label>choose a day</label>
        <select name="day">
            <option disabled selected>choose</option>
            <option value="monday">Monday</option>
            <option value="tuesday">Tuesday</option>
            <option value="wednesday">Wednesday</option>
            <option value="thursday">Thursday</option>
            <option value="friday">Friday</option>
            <option value="saturday">Saturday</option>
            <option value="sunday">Sunday</option>
        </select>
        <button type="submit">Go</button>
    </form>

    <?php } ?>
</body>

</html>