摘要:[PHP]GET/POST 的差異與配合PHP用法
[鐵人賽Day2] GET/POST 的差異與配合PHP用法
<form id="form1" method="(GET or POST)" action="">
-內容物-
</form>
那到底GET/POST差別在哪呢?
<html>
<head>
<title>iTHome_Test</title>
<meta http-equiv="content-type" charset="UTF-8" />
</head>
<body>
<form method="GET" action="./test2.php">
帳號:<input name="username" type="text" />
<br />
密碼:<input name="password" type="password" />
<br />
<input type="submit" value="確定送出" />
</form>
</body>
</html>
test2.php
<html>
<head>
<title>iTHome_Test</title>
<meta http-equiv="content-type" charset="UTF-8" />
</head>
<body>
<?php
$get_value1=$_GET['username'];
$get_value2=$_GET['password'];
echo "帳號:".$get_value1."<br />密碼:".$get_value2;
?>
</body>
</html>
test1.php