Blogger Information
Blog 25
fans 0
comment 0
visits 19760
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
post应用案例-4-15
moonheart的博客
Original
721 people have browsed it

<?php
/**
 * Created by PhpStorm.
 * User: ymz
 * Date: 2019-4-15
 * Time: 21:59
 */
$headline="post";
if(!empty($_POST)){
    $user=$_POST['user'];
    $pw=$_POST['password'];
    echo '<pre><br><hr><b>'.$headline.'输出:</b><hr>';
    print_r($_POST);
    echo '</pre>';
}


?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?php echo $headline;?></title>
    <style type="text/css">
        div{width: 400px; height: 300px;margin: 50px auto;border:1px solid blue;padding: 10px;}
        h2{text-align: center;}
    </style>
</head>
<body>
<div>
<h2><?php echo $headline; ?></h2>
    <hr>
    <form action="" method="post">
        <p>
        <label>用户:</label>
        <input type="text" name="user" value="<?=(!empty($user))?$user:'';?>">
        </p>
        <p><label>密码:</label>
            <input type="password" name="password" value="<?=(!empty($pw))?$pw:'';?>">
        </p>
        <p>
            <button>提交</button>
        </p>
    </form>
</div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

header页面头部进行参数传递,通过$_POST接收相关数据。

微信截图_20190416133433.png

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post