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

实例

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

运行实例 »

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

get方法的应用,主要是键值对,但容易暴露一些敏感信息。

微信截图_20190416133033.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