Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php代码不工作?_Php_Web - Fatal编程技术网

php代码不工作?

php代码不工作?,php,web,Php,Web,我是php代码的新手。我的'learn.php'代码工作不正常。我猜POST字段有一些问题。 任何帮助都将不胜感激,请推荐一个好的php调试器,因为我正在使用WebMatrix。 我的Index.php文件: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Information Gethering&l

我是php代码的新手。我的'learn.php'代码工作不正常。我猜POST字段有一些问题。 任何帮助都将不胜感激,请推荐一个好的php调试器,因为我正在使用WebMatrix。 我的Index.php文件:

<!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文件:

<!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>

欢迎光临!

您忘记了变量

<!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 $firstname. 'CEO <br>';//changed $name + took </br> in comma + replaced </br> with <br>
        echo $lastname. 'WTF? <br>';//changed $last
        echo $age. 'Cool <br>';

        ?>

    </body>
</html>

欢迎光临!

错误是什么?lern.php给了我一个空页面。请使用错误报告(E\u通知),以便您可以轻松检查未初始化的变量或捕获变量名称拼写错误。谢谢,我应该使用什么调试器?我从来都不需要它们。浏览器为我做这件事…你需要打开错误报告。这将在浏览器中显示PHP错误。将此标记添加到文件的顶部。有关错误报告的详细信息,请访问:和