首页 > 解决方案 > 注册表不显示输入

问题描述

我正在制作一个注册表单并制作了一些简单的 php 来处理电子邮件作为测试:

    Hello  <?php echo $_POST["email"]; ?>

我正在使用 post 方法,虽然 atom 编辑器显示 Hello,但它不显示电子邮件。

如果有人需要它,这是我正在使用的 html:

    <form action="welcome.php" method="post">
    <div class="container">
    <h1>Register</h1>
    <p>Please fill in this form to create an account.</p>
    <hr>

    <label for="email"><b>Email</b></label>
    <input type="text" placeholder="Enter Email" name="email" required>

    <label for="psw"><b>Password</b></label>
    <input type="password" placeholder="Enter Password" name="psw" 
    required>

    <label for="psw-repeat"><b>Repeat Password</b></label>
    <input type="password" placeholder="Repeat Password" name="psw- 
    repeat" 
    required>
    <hr>
    <p>By creating an account you agree to our <a href="#">Terms & 
    Privacy</a>.</p>

    <button type="submit" class="registerbtn">Register</button>
    </div>

    <div class="container signin">
    <p>Already have an account? <a href="#">Sign in</a>.</p>
    </div>
    </form>

标签: phpformsregistration

解决方案


没有错误。如果将上面提供的php代码放在welcome.php中,并填写表格,在Hello之后可以正常显示email。有可能


推荐阅读