안효원 안효원 2022-01-12
merge
@87e7c1f0f6729ad6a0092952858e11321e4a5fbd
form.php
--- form.php
+++ form.php
@@ -8,22 +8,12 @@
     <title>form</title>
 </head>
 <body>
-    <h3>Get</h3>
-    <form action="get.php" method="get">
-        ID : <input type="text" name="id"><br>
-        P/W : <input type="password" name="pw">
-        <input type="submit">
-    </form>
-
-    <br>
-    <hr>
-
-    <h3>Post</h3>
+    <h3>Get/Post</h3>
     <form action="post.php" method="post">
         ID : <input type="text" name="id"><br>
         P/W : <input type="password" name="pw">
         <input type="submit" value="POST">
-        <button formaction="get.php?id=<?php echo $_GET["id"] ?>&pw=<?php echo $_GET["pw"] ?>">GET</button>
+        <a href="get.php?id=<?php echo $_GET["id"] ?>&pw=<?php echo $_GET["pw"] ?>">GET</a>
     </form>
 </body>
 </html>
(No newline at end of file)
form_1.php
--- form_1.php
+++ form_1.php
@@ -8,7 +8,7 @@
     <title>Document</title>
 </head>
 <body>
-    <form action="form_1_receive.php">
+    <form action="form_1_receive.php" method="post">
         과일을 입력하세요 : <input type="text" name="fruits">
         <input type="submit">
     </form>
form_1_receive.php
--- form_1_receive.php
+++ form_1_receive.php
@@ -1,4 +1,4 @@
 <?php
-    $fruits = $_GET["fruits"];
+    $fruits = $_POST["fruits"];
 
     echo "과일 : " . $fruits;
(No newline at end of file)
Add a comment
List