dimanche 27 décembre 2015

I can't solvebasic code form in php

I am new in Php world. This is my first question ever in any form. Please tell me what errors in my page. When i submit form no result came out. Please give me any solution.

I try to follow this video. https://www.youtube.com/watch?v=15Ucddc2ksM

enter code here

<!Doctype html>
<html>
<head>
    <title> My page </title>``
</head>
<body>

    <p style="font-weight:bold">hello1 world</p>
    <?php

    // Restaruant open at 8
    // Restaruant from 8-11
    // Lunch from 11-4
    // closes at 4
    $launch_menu = "Nashta <br /> 
    halwa <br /> gosher <br /> ";

    $breakfast_menu = "Launch <br />
    sugar <br /> meat <br /> ";

    if(isset($_post['time'])) {
        $time = $_post['time'];

        if($time < 8 or $time >= 16 ) {
            echo "sorry, we are closed <br />" ;
        }
        else{
            echo "Hi, what would you like order <br /> ";
            if($time < 11){
                echo $breakfast_menu;
            }
            else if ($time < 16)
            {
                echo $launch_menu;
            }
        }
    }

    ?>
    <form action='index.php' method='post'>
    What time is it? <input type='text' name='time' /> <br />
    <input type='submit' value='Submit'>
    </form>
</body>
</html>

Aucun commentaire:

Enregistrer un commentaire