안효원 안효원 2022-01-13
require add
@2d367d179e615cd455609a4a99e1dde1f0447e66
20220113/login.php
--- 20220113/login.php
+++ 20220113/login.php
@@ -7,7 +7,7 @@
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <title>Document</title>
     <style>
-        #page {margin: 0 auto; width: 360px; background-color: antiquewhite; text-align: center; position: relative; top: 100px;}
+        #page {margin: 0 auto; width: 360px; background-color: silver; text-align: center; position: relative; top: 100px;}
         .send {width: 100%; height: 4em;}
         form {position: relative; left: 65px;}
     </style>
20220113/loginBack.php
--- 20220113/loginBack.php
+++ 20220113/loginBack.php
@@ -8,17 +8,9 @@
     $result = "";
 
     if($userId == $id && $userPw == $pw){
-        $result = "true";
-    }else{
-        $result = "false";
-    }
-
-    if($result == "true"){
-        echo "<script>document.location.href='success.php'</script>";
+//        echo "<script>document.location.href='success.php?id='" . $userId . "</script>";
+        header('Location:success.php?id=' . $userId);
     }else{
         echo "<script>alert('Login Fail!')</script>";
         echo "<script>document.location.href='login.php'</script>";
-    }
-
-
-
+    }
(No newline at end of file)
 
20220113/require_1.php (added)
+++ 20220113/require_1.php
@@ -0,0 +1,4 @@
+<?php
+    echo "This is Require 1 Page <br>";
+
+    $fruits = "Apple";
 
20220113/require_2.php (added)
+++ 20220113/require_2.php
@@ -0,0 +1,4 @@
+<?php
+    echo "This is Require 2 Page <br>";
+
+    $fruits = "Orange";
 
20220113/require_main.php (added)
+++ 20220113/require_main.php
@@ -0,0 +1,14 @@
+<?php
+    /**
+     * @var $fruits
+     */
+    require_once ("require_1.php");
+
+
+    echo "This is Main Page <br>";
+
+    echo "Defined index at Page 1 is : <em>" . $fruits . "</em><br>";
+
+    require_once ("require_2.php");
+
+    echo "Defined index at Page 2 is : <em>" . $fruits . "</em><br>";(No newline at end of file)
20220113/success.php
--- 20220113/success.php
+++ 20220113/success.php
@@ -8,7 +8,7 @@
     <title>Document</title>
 </head>
 <body>
-    <h1>Login Success!!!</h1>
+<h1><em><?php echo $_GET['id'] ?></em>, Login Success!!!</h1>
     <button onclick="document.location.href='login.php'">돌아가기</button>
 </body>
 </html>
 
page/contents.php (added)
+++ page/contents.php
@@ -0,0 +1,5 @@
+    <h2>This is Contents Sector</h2>
+    <hr>
+    <div>
+        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, perferendis!
+    </div>
 
page/contents2.php (added)
+++ page/contents2.php
@@ -0,0 +1,11 @@
+<div>
+    <h2>This is News Page</h2>
+    <hr>
+    <ul>
+        <li>Lorem ipsum dolor.</li>
+        <li>Lorem ipsum dolor.</li>
+        <li>Lorem ipsum dolor.</li>
+        <li>Lorem ipsum dolor.</li>
+        <li>Lorem ipsum dolor.</li>
+    </ul>
+</div>(No newline at end of file)
 
page/header.php (added)
+++ page/header.php
@@ -0,0 +1,6 @@
+<?php
+            echo "<h2>This is Header Sector</h2>";
+            echo "<hr>";
+            echo "<div>";
+            echo "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, perferendis!";
+            echo "</div>";
 
page/index.php (added)
+++ page/index.php
@@ -0,0 +1,42 @@
+<!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>Home Page</title>
+    <style>
+        #page {background-color: antiquewhite; width: 500px; margin: 0 auto;}
+        h2 {text-align: center;}
+        .div1 {background-color: brown}
+        .div2 {background-color: olive;}
+        .div3 {background-color: blueviolet;}
+    </style>
+</head>
+<body>
+    <div id="page">
+
+        <div class="div1">
+            <?php require_once ("header.php")?>
+        </div>
+
+        <div class="div2">
+            <?php
+                if($_GET["page"] == "contents"){
+                    require_once ("contents.php");
+                }else if($_GET["page"] == "news"){
+                    require_once("contents2.php");
+                }else{
+                    echo "No Information";
+                }
+            ?>
+        </div>
+
+        <div class="div3">
+            <?php require_once ("tail.php")?>
+        </div>
+
+    </div>
+</body>
+</html>(No newline at end of file)
 
page/tail.php (added)
+++ page/tail.php
@@ -0,0 +1,6 @@
+<?php
+    echo "<h2>This is Tail Sector</h2>";
+    echo "<hr>";
+    echo "<div>";
+    echo "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, perferendis!";
+    echo "</div>";
Add a comment
List