--- form.php
+++ form.php
... | ... | @@ -8,22 +8,12 @@ |
8 | 8 |
<title>form</title> |
9 | 9 |
</head> |
10 | 10 |
<body> |
11 |
- <h3>Get</h3> |
|
12 |
- <form action="get.php" method="get"> |
|
13 |
- ID : <input type="text" name="id"><br> |
|
14 |
- P/W : <input type="password" name="pw"> |
|
15 |
- <input type="submit"> |
|
16 |
- </form> |
|
17 |
- |
|
18 |
- <br> |
|
19 |
- <hr> |
|
20 |
- |
|
21 |
- <h3>Post</h3> |
|
11 |
+ <h3>Get/Post</h3> |
|
22 | 12 |
<form action="post.php" method="post"> |
23 | 13 |
ID : <input type="text" name="id"><br> |
24 | 14 |
P/W : <input type="password" name="pw"> |
25 | 15 |
<input type="submit" value="POST"> |
26 |
- <button formaction="get.php?id=<?php echo $_GET["id"] ?>&pw=<?php echo $_GET["pw"] ?>">GET</button> |
|
16 |
+ <a href="get.php?id=<?php echo $_GET["id"] ?>&pw=<?php echo $_GET["pw"] ?>">GET</a> |
|
27 | 17 |
</form> |
28 | 18 |
</body> |
29 | 19 |
</html>(No newline at end of file) |
--- form_1.php
+++ form_1.php
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 |
<title>Document</title> |
9 | 9 |
</head> |
10 | 10 |
<body> |
11 |
- <form action="form_1_receive.php"> |
|
11 |
+ <form action="form_1_receive.php" method="post"> |
|
12 | 12 |
과일을 입력하세요 : <input type="text" name="fruits"> |
13 | 13 |
<input type="submit"> |
14 | 14 |
</form> |
--- form_1_receive.php
+++ form_1_receive.php
... | ... | @@ -1,4 +1,4 @@ |
1 | 1 |
<?php |
2 |
- $fruits = $_GET["fruits"]; |
|
2 |
+ $fruits = $_POST["fruits"]; |
|
3 | 3 |
|
4 | 4 |
echo "과일 : " . $fruits;(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?