32 lines
833 B
PHP
32 lines
833 B
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Form Test 2</title>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
// 获取表单提交数据
|
|
$name = htmlspecialchars($_POST['name']);
|
|
$password = md5($_POST['password']);
|
|
|
|
// 输出结果
|
|
echo "<p>提交后的姓名:$name</p>";
|
|
echo "<p>处理后的密码:$password</p>";
|
|
}
|
|
?>
|
|
|
|
<form action="form_test_2.php" method="post">
|
|
<label for="name">姓名:</label>
|
|
<input type="text" id="name" name="name" value=""><br><br>
|
|
|
|
<label for="password">密码:</label>
|
|
<input type="password" id="password" name="password" value=""><br><br>
|
|
|
|
<input type="submit" id="ok" name="ok" value="提交">
|
|
</form>
|
|
</body>
|
|
</html>
|