zoukankan      html  css  js  c++  java
  • php注册界面,实现php欢迎用户登录界面

    实现效果如图:

    php实现代码如下:


    <!DOCTYPE HTML>
    <html>
    <head>
    <meta name="" content=""charset="utf-8"/>
    </head>
    <body>

    <?php
    // define variables and set to empty values
    $name = $email = $gender = $comment = $website = "";

    if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = test_input($_POST["name"]);
    $email = test_input($_POST["email"]);
    $website = test_input($_POST["website"]);
    $comment = test_input($_POST["comment"]);
    $gender = test_input($_POST["gender"]);
    }

    function test_input($data) {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
    }
    ?>

    <h2>注册评论界面</h2>
    <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
    姓名:<input type="text" name="name">
    <br><br>
    性别:
    <input type="radio" name="gender" value="female">女性
    <input type="radio" name="gender" value="male">男性
    <br><br>
    qq:<input type="text" name="email">
    <br><br>
    电话:<input type="text" name="website">
    <br><br>
    评论:<textarea name="comment" rows="5" cols="40"></textarea>
    <br><br>

    <br><br>
    <input type="submit" name="submit" value="提交">
    </form>

    <?php
    echo "<h2>欢迎您注册登录:</h2>";
    echo '欢迎:' . $name;
    echo "<br>";
    echo '你的性别是:' .$gender;
    echo "<br>";
    echo '你的qq是:' .$email;
    echo "<br>";
    echo '你的电话是:' .$website;
    echo "<br>";
    echo '你的评论是:' .$comment;


    ?>

    </body>
    </html>

  • 相关阅读:
    python基础-递归
    python基础-三元表达式/列表推导式/生成器表达式
    python基础-生成器
    python基础-迭代器
    python基础-函数
    python基础-文件操作
    Docker(六)安装Red5进行rtmp推流
    Docker(五)安装Fastdfs
    Docker(四)安装Redis
    Docker(三)安装Mysql
  • 原文地址:https://www.cnblogs.com/taoda/p/9363170.html
Copyright © 2011-2022 走看看