首页 > 代码库 > php基础09:提取表单数据

php基础09:提取表单数据

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <form method="POST" action="08-formData.php">
        <p>姓名:<input type="text" name="username"></p>
        <p>密码:<input type="text" name="password"></p>
        <button type="submit">提交</button>
    </form>
</body>
</html>

<?php

    //将上个页面的表单中的字段的value值,提取出来
    $username =  $_POST[‘username‘];
    $password = $_POST[‘password‘];
    echo $username."你好,您的密码是".$password;

?>

 

php基础09:提取表单数据