$_POST
$_GET
$_REQUEST
$_REQUEST
= $_GET+$_POST+$_COOKIE
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<form action="form.php" method="get">
用戶名:<br>
<input type="text" name="username" placeholder="請輸入用戶名">
<br>
密碼:<br>
<input type="password" name="password" placeholder="請輸入密碼">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
複製代碼
<?php
echo "用戶名爲: $_POST[username]";
echo "<br/>";
echo "密碼爲: $_POST[password]";
echo "<hr/>";
$table_html = <<<TABLE <table border="1" width="80%"> <tr> <td>用戶名</td> <td>$_POST[username]</td> </tr> <tr> <td>密碼</td> <td>$_POST[password]</td> </tr> </table> TABLE;
echo $table_html;
複製代碼
書寫以上效果的form表單, 使用post方式接受參數, 使用php代碼生成一個列表, 列表樣式自定義php