vendredi 1 avril 2016

php code not working?

I am newbie to php code. My 'learn.php' code is not working properly. I guess there is some problem with the POST fields. Any helps would be appreciated and please suggest a good debugger for php as i am using WebMatrix. My Index.php File:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Information Gethering</title>

    </head>
    <body>
     <h1>Welcome TO my Portal login</h1>   
        <form action="learn.php" method="post">
        First name: <br>
            <input type="text" name="firstname"><br> 
       Last name:<br> 

         <input type="text" name="lastname"><br> 

    Age: <br>

            <input type="text" name="age"><br> 
            <input type="submit" value="Submit">
        </form>
    </body>
</html> 

Learn.php file:

<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Welcome Guest!</title>
    </head>
    <body>
        <?php
        echo" <p>You are logged In Gust!</p>";    
        $firstname=$_POST['firstname'];
        $lastname=$_POST['lastname'];
        $age=$_POST['age'];

        echo'<p> your details are as: </p>';
        echo $name. 'CEO' </br>;
        echo $last. 'WTF?' </br>;
        echo $age. 'Cool' </br>;

        ?>

    </body>
</html>




Aucun commentaire:

Enregistrer un commentaire