--- 20220113/login.php
+++ 20220113/login.php
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> |
8 | 8 |
<title>Document</title> |
9 | 9 |
<style> |
10 |
- #page {margin: 0 auto; width: 360px; background-color: antiquewhite; text-align: center; position: relative; top: 100px;} |
|
10 |
+ #page {margin: 0 auto; width: 360px; background-color: silver; text-align: center; position: relative; top: 100px;} |
|
11 | 11 |
.send {width: 100%; height: 4em;} |
12 | 12 |
form {position: relative; left: 65px;} |
13 | 13 |
</style> |
--- 20220113/loginBack.php
+++ 20220113/loginBack.php
... | ... | @@ -8,17 +8,9 @@ |
8 | 8 |
$result = ""; |
9 | 9 |
|
10 | 10 |
if($userId == $id && $userPw == $pw){ |
11 |
- $result = "true"; |
|
12 |
- }else{ |
|
13 |
- $result = "false"; |
|
14 |
- } |
|
15 |
- |
|
16 |
- if($result == "true"){ |
|
17 |
- echo "<script>document.location.href='success.php'</script>"; |
|
11 |
+// echo "<script>document.location.href='success.php?id='" . $userId . "</script>"; |
|
12 |
+ header('Location:success.php?id=' . $userId); |
|
18 | 13 |
}else{ |
19 | 14 |
echo "<script>alert('Login Fail!')</script>"; |
20 | 15 |
echo "<script>document.location.href='login.php'</script>"; |
21 |
- } |
|
22 |
- |
|
23 |
- |
|
24 |
- |
|
16 |
+ }(No newline at end of file) |
+++ 20220113/require_1.php
... | ... | @@ -0,0 +1,4 @@ |
1 | +<?php | |
2 | + echo "This is Require 1 Page <br>"; | |
3 | + | |
4 | + $fruits = "Apple"; |
+++ 20220113/require_2.php
... | ... | @@ -0,0 +1,4 @@ |
1 | +<?php | |
2 | + echo "This is Require 2 Page <br>"; | |
3 | + | |
4 | + $fruits = "Orange"; |
+++ 20220113/require_main.php
... | ... | @@ -0,0 +1,14 @@ |
1 | +<?php | |
2 | + /** | |
3 | + * @var $fruits | |
4 | + */ | |
5 | + require_once ("require_1.php"); | |
6 | + | |
7 | + | |
8 | + echo "This is Main Page <br>"; | |
9 | + | |
10 | + echo "Defined index at Page 1 is : <em>" . $fruits . "</em><br>"; | |
11 | + | |
12 | + require_once ("require_2.php"); | |
13 | + | |
14 | + echo "Defined index at Page 2 is : <em>" . $fruits . "</em><br>";(No newline at end of file) |
--- 20220113/success.php
+++ 20220113/success.php
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 |
<title>Document</title> |
9 | 9 |
</head> |
10 | 10 |
<body> |
11 |
- <h1>Login Success!!!</h1> |
|
11 |
+<h1><em><?php echo $_GET['id'] ?></em>, Login Success!!!</h1> |
|
12 | 12 |
<button onclick="document.location.href='login.php'">돌아가기</button> |
13 | 13 |
</body> |
14 | 14 |
</html> |
+++ page/contents.php
... | ... | @@ -0,0 +1,5 @@ |
1 | + <h2>This is Contents Sector</h2> | |
2 | + <hr> | |
3 | + <div> | |
4 | + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, perferendis! | |
5 | + </div> |
+++ page/contents2.php
... | ... | @@ -0,0 +1,11 @@ |
1 | +<div> | |
2 | + <h2>This is News Page</h2> | |
3 | + <hr> | |
4 | + <ul> | |
5 | + <li>Lorem ipsum dolor.</li> | |
6 | + <li>Lorem ipsum dolor.</li> | |
7 | + <li>Lorem ipsum dolor.</li> | |
8 | + <li>Lorem ipsum dolor.</li> | |
9 | + <li>Lorem ipsum dolor.</li> | |
10 | + </ul> | |
11 | +</div>(No newline at end of file) |
+++ page/header.php
... | ... | @@ -0,0 +1,6 @@ |
1 | +<?php | |
2 | + echo "<h2>This is Header Sector</h2>"; | |
3 | + echo "<hr>"; | |
4 | + echo "<div>"; | |
5 | + echo "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, perferendis!"; | |
6 | + echo "</div>"; |
+++ page/index.php
... | ... | @@ -0,0 +1,42 @@ |
1 | +<!doctype html> | |
2 | +<html lang="ko"> | |
3 | +<head> | |
4 | + <meta charset="UTF-8"> | |
5 | + <meta name="viewport" | |
6 | + content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
8 | + <title>Home Page</title> | |
9 | + <style> | |
10 | + #page {background-color: antiquewhite; width: 500px; margin: 0 auto;} | |
11 | + h2 {text-align: center;} | |
12 | + .div1 {background-color: brown} | |
13 | + .div2 {background-color: olive;} | |
14 | + .div3 {background-color: blueviolet;} | |
15 | + </style> | |
16 | +</head> | |
17 | +<body> | |
18 | + <div id="page"> | |
19 | + | |
20 | + <div class="div1"> | |
21 | + <?php require_once ("header.php")?> | |
22 | + </div> | |
23 | + | |
24 | + <div class="div2"> | |
25 | + <?php | |
26 | + if($_GET["page"] == "contents"){ | |
27 | + require_once ("contents.php"); | |
28 | + }else if($_GET["page"] == "news"){ | |
29 | + require_once("contents2.php"); | |
30 | + }else{ | |
31 | + echo "No Information"; | |
32 | + } | |
33 | + ?> | |
34 | + </div> | |
35 | + | |
36 | + <div class="div3"> | |
37 | + <?php require_once ("tail.php")?> | |
38 | + </div> | |
39 | + | |
40 | + </div> | |
41 | +</body> | |
42 | +</html>(No newline at end of file) |
+++ page/tail.php
... | ... | @@ -0,0 +1,6 @@ |
1 | +<?php | |
2 | + echo "<h2>This is Tail Sector</h2>"; | |
3 | + echo "<hr>"; | |
4 | + echo "<div>"; | |
5 | + echo "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, perferendis!"; | |
6 | + echo "</div>"; |
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?