Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

public_html/exercises/

formulärsvar.php
incl/
kakan3.php
sida1.php
sida2.php
sida3.php
uppg-cookiesession1.php
uppg-cookiesession2.php
uppg-cookiesession3.php
uppg-form1.php
uppg-formulär1.php
uppg-formulär2.php
uppg-formulär4.php
uppg-funk.php
uppg-inklFiler.php
uppg1-5.php
välkomst.php

uppg-formulär4.php

97 lines UTF-8 Windows (CRLF)
<!DOCTYPE html>
<html lang="sv">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>The bridge of death</title>
    <style>
        body {
            text-align: center;
            padding: 10px;
        }
        #thename {
            display: none;
        }
        #thequest {
            display: none;
        }
        #thecolour {
            display: none;
        }
        #thedone {
            display: none;
        }
    </style>
</head>
<body>
    <div id="thesecurity">
    <form onsubmit="return first()">
        <input type="password" placeholder="lösenordet :>" pattern="yehaa!" size="10"><br>
        <button type="submit">Starta formuläret</button>
    </form>
    </div>
    <form action="formulärsvar.php" method="post">
        <div id="thename">
        <fieldset>
            <legend>What is your name?</legend>
                <input type="radio" value="Lancelot" name="namn" onclick="second()">
                <label for="Lancelot">My name is Sir Lancelot of Cammelot!</label><br>
                <input type="radio" value="Robin" name="namn" onclick="second()">
                <label for="Robin">Sir Robin of Cammelot!</label><br>
                <input type="radio" value="Gallahad" name="namn" onclick="second()">
                <label for="Gallahad">Sir Gallahad of Cammelot!</label><br>
                <input type="radio" value="Arthur" name="namn" onclick="second()">
                <label for="Arthur">It is Arthur, kind of the Brittains!</label>
        </fieldset>
        </div>
        <div id="thequest">
        <fieldset >
            <legend>What is your quest?</legend>
                <input type="radio" value="Grail" name="quest" onclick="third()">
                <label for="Blue">To seek the holy grail!</label><br>
                <input type="radio" value="Swallow" name="quest" onclick="third()">
                <label for="Green">To learn the differences between an african and a european swallow!</label><br>
                <input type="radio" value="Fart" name="quest" onclick="third()">
                <label for="Yellow">To fart in your general direction!</label><br>
                <input type="radio" value="Siberia" name="quest" onclick="third()">
                <label for="Red">To learn about the capital of Siberia!</label>
        </fieldset>
        </div>
        <div id="thecolour">
        <fieldset>
            <legend>What is your favourite colour?</legend>
                <input type="radio" value="Blue" name="fav_colour" onclick="done()">
                <label for="Blue">Blue!</label><br>
                <input type="radio" value="Green" name="fav_colour" onclick="done()">
                <label for="Green">Green!</label><br>
                <input type="radio" value="Yellow" name="fav_colour" onclick="done()">
                <label for="Yellow">Yellow!</label><br>
                <input type="radio" value="Red" name="fav_colour" onclick="done()">
                <label for="Red">Red!</label>
        </fieldset>
        </div>
        <div id="thedone">
        <button type="submit">skicka in eller något ja venne</button>
        </div>
    </form>
    <script>
        function first() {
            event.preventDefault();
            document.getElementById('thesecurity').style.display = "none";
            document.getElementById('thename').style.display = "block";
        }
        function second() {
            document.getElementById('thename').style.display = "none";
            document.getElementById('thequest').style.display = "block";
        }
        function third() {
            document.getElementById('thequest').style.display = "none";
            document.getElementById('thecolour').style.display = "block";
        }
        function done() {
            document.getElementById('thecolour').style.display = "none";
            document.getElementById('thedone').style.display = "block";
        }
    </script>
</body>
</html>