samedi 24 mars 2018

Html/php form not out-putting

hi i'm trying to implement a small feature including a price checker (just testing for now!) but when i hit submit nothing is ecohed back to me! here is my code:

<!doctype html>
<head>
    <meta charset="UTF-8">    
    <title>ValleyRangesPriceCheck</title>
    <link REL='stylesheet' TYPE='text/css' HREF='Style.css'>
</head>
<body>
    <form>
        <input type="date" name="check-in">
        <input type="date" name="check-out">
        <input type="number" name="num-of-guests" min="1" max="10" placeholder="Guests">
        <select name="operator">
            <option>Candelight</option>
            <option>Misty Woods</option>
            <option>Beach Mont</option>
        </select>

        <button type="submit" name="submit" value="submit">submit</button>
    </form>
    <p> The Answer Is:</p>
    <?php
        if (isset($_GET['submit'])){
            $result1 = $_GET['check-in'];
            $result2 = $_GET['check-out'];
            $operator = $_GET['operator'];
                switch ($operator){
                    case "Candelight":
                        echo $result1 + $result2;
                        break;
                }
        }
    ?>
</body>
</html>

Thanks for the help!




Aucun commentaire:

Enregistrer un commentaire