안효원 안효원 2022-01-07
form add2
@e1b8f4c86932afee96d1a3f14ccc9ef8986bb51c
form.php
--- form.php
+++ form.php
@@ -14,13 +14,16 @@
         P/W : <input type="password" name="pw">
         <input type="submit">
     </form>
+
     <br>
     <hr>
+
     <h3>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">
+        <input type="submit" value="POST">
+        <button formaction="get.php?id=<?php echo $_GET["id"] ?>&pw=<?php echo $_GET["pw"] ?>">GET</button>
     </form>
 </body>
 </html>
(No newline at end of file)
 
form_1.php (added)
+++ form_1.php
@@ -0,0 +1,16 @@
+<!doctype html>
+<html lang="ko">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>Document</title>
+</head>
+<body>
+    <form action="form_1_receive.php">
+        과일을 입력하세요 : <input type="text" name="fruits">
+        <input type="submit">
+    </form>
+</body>
+</html>(No newline at end of file)
 
form_1_receive.php (added)
+++ form_1_receive.php
@@ -0,0 +1,4 @@
+<?php
+    $fruits = $_GET["fruits"];
+
+    echo "과일 : " . $fruits;(No newline at end of file)
Add a comment
List