--- .idea/dataSources/482ad897-bf06-4872-a94f-ca218d669792.xml
+++ .idea/dataSources/482ad897-bf06-4872-a94f-ca218d669792.xml
... | ... | @@ -1054,67 +1054,78 @@ |
1054 | 1054 |
<table id="333" parent="2" name="data"> |
1055 | 1055 |
<Collation>utf8mb4_unicode_ci</Collation> |
1056 | 1056 |
</table> |
1057 |
- <table id="334" parent="2" name="reply"> |
|
1057 |
+ <table id="334" parent="2" name="login"/> |
|
1058 |
+ <table id="335" parent="2" name="reply"> |
|
1058 | 1059 |
<Collation>utf8mb4_unicode_ci</Collation> |
1059 | 1060 |
</table> |
1060 |
- <column id="335" parent="333" name="num"> |
|
1061 |
+ <column id="336" parent="333" name="num"> |
|
1061 | 1062 |
<Position>1</Position> |
1062 | 1063 |
<DataType>int(11)|0s</DataType> |
1063 | 1064 |
<NotNull>1</NotNull> |
1064 | 1065 |
<SequenceIdentity>null</SequenceIdentity> |
1065 | 1066 |
</column> |
1066 |
- <column id="336" parent="333" name="writer"> |
|
1067 |
+ <column id="337" parent="333" name="writer"> |
|
1067 | 1068 |
<Position>2</Position> |
1068 | 1069 |
<DataType>varchar(50)|0s</DataType> |
1069 | 1070 |
</column> |
1070 |
- <column id="337" parent="333" name="title"> |
|
1071 |
+ <column id="338" parent="333" name="title"> |
|
1071 | 1072 |
<Position>3</Position> |
1072 | 1073 |
<DataType>varchar(50)|0s</DataType> |
1073 | 1074 |
</column> |
1074 |
- <column id="338" parent="333" name="contents"> |
|
1075 |
+ <column id="339" parent="333" name="contents"> |
|
1075 | 1076 |
<Position>4</Position> |
1076 | 1077 |
<DataType>varchar(500)|0s</DataType> |
1077 | 1078 |
</column> |
1078 |
- <column id="339" parent="333" name="date"> |
|
1079 |
+ <column id="340" parent="333" name="date"> |
|
1079 | 1080 |
<Position>5</Position> |
1080 | 1081 |
<DataType>date|0s</DataType> |
1081 | 1082 |
</column> |
1082 |
- <column id="340" parent="333" name="view"> |
|
1083 |
+ <column id="341" parent="333" name="view"> |
|
1083 | 1084 |
<Position>6</Position> |
1084 | 1085 |
<DataType>int(11)|0s</DataType> |
1085 | 1086 |
</column> |
1086 |
- <column id="341" parent="333" name="file"> |
|
1087 |
+ <column id="342" parent="333" name="file"> |
|
1087 | 1088 |
<Position>7</Position> |
1088 | 1089 |
<DataType>varchar(300)|0s</DataType> |
1089 | 1090 |
</column> |
1090 |
- <key id="342" parent="333" name="PRIMARY"> |
|
1091 |
+ <key id="343" parent="333" name="PRIMARY"> |
|
1091 | 1092 |
<NameSurrogate>1</NameSurrogate> |
1092 | 1093 |
<ColNames>num</ColNames> |
1093 | 1094 |
<Primary>1</Primary> |
1094 | 1095 |
</key> |
1095 |
- <column id="343" parent="334" name="num"> |
|
1096 |
+ <column id="344" parent="334" name="id"> |
|
1097 |
+ <Position>1</Position> |
|
1098 |
+ <DataType>varchar(255)|0s</DataType> |
|
1099 |
+ <NotNull>1</NotNull> |
|
1100 |
+ </column> |
|
1101 |
+ <column id="345" parent="334" name="pw"> |
|
1102 |
+ <Position>2</Position> |
|
1103 |
+ <DataType>varchar(255)|0s</DataType> |
|
1104 |
+ <NotNull>1</NotNull> |
|
1105 |
+ </column> |
|
1106 |
+ <column id="346" parent="335" name="num"> |
|
1096 | 1107 |
<Position>1</Position> |
1097 | 1108 |
<DataType>int(11)|0s</DataType> |
1098 | 1109 |
<NotNull>1</NotNull> |
1099 | 1110 |
<SequenceIdentity>null</SequenceIdentity> |
1100 | 1111 |
</column> |
1101 |
- <column id="344" parent="334" name="con_num"> |
|
1112 |
+ <column id="347" parent="335" name="con_num"> |
|
1102 | 1113 |
<Position>2</Position> |
1103 | 1114 |
<DataType>int(11)|0s</DataType> |
1104 | 1115 |
</column> |
1105 |
- <column id="345" parent="334" name="reply_writer"> |
|
1116 |
+ <column id="348" parent="335" name="reply_writer"> |
|
1106 | 1117 |
<Position>3</Position> |
1107 | 1118 |
<DataType>varchar(50)|0s</DataType> |
1108 | 1119 |
</column> |
1109 |
- <column id="346" parent="334" name="reply_content"> |
|
1120 |
+ <column id="349" parent="335" name="reply_content"> |
|
1110 | 1121 |
<Position>4</Position> |
1111 | 1122 |
<DataType>varchar(100)|0s</DataType> |
1112 | 1123 |
</column> |
1113 |
- <column id="347" parent="334" name="reply_pw"> |
|
1124 |
+ <column id="350" parent="335" name="reply_pw"> |
|
1114 | 1125 |
<Position>5</Position> |
1115 | 1126 |
<DataType>int(11)|0s</DataType> |
1116 | 1127 |
</column> |
1117 |
- <key id="348" parent="334" name="PRIMARY"> |
|
1128 |
+ <key id="351" parent="335" name="PRIMARY"> |
|
1118 | 1129 |
<NameSurrogate>1</NameSurrogate> |
1119 | 1130 |
<ColNames>num</ColNames> |
1120 | 1131 |
<Primary>1</Primary> |
--- config/signIn.php
+++ config/signIn.php
... | ... | @@ -1,1 +1,32 @@ |
1 | 1 |
<?php |
2 |
+ /** |
|
3 |
+ * @var $mysqli |
|
4 |
+ */ |
|
5 |
+ ini_set("display_errors", "1"); |
|
6 |
+ include("db.config.php"); |
|
7 |
+ |
|
8 |
+ /* Posted information */ |
|
9 |
+ $id = $_POST['id']; |
|
10 |
+ $pw = $_POST['pw']; |
|
11 |
+ |
|
12 |
+ $query = "select * from login where id = '$id' "; |
|
13 |
+ $result = $mysqli->query($query); |
|
14 |
+ |
|
15 |
+ $data = mysqli_fetch_array($result); |
|
16 |
+ if($id != null && $pw != null){ |
|
17 |
+ if($data[0] == $id){ |
|
18 |
+ if($data[1] == $pw){ |
|
19 |
+ echo "<script>alert('로그인 성공');</script>"; |
|
20 |
+ echo "<meta http-equiv='refresh' content='0.1; url=../main.php'>"; |
|
21 |
+ }else{ |
|
22 |
+ echo "<script>alert('회원정보를 확인하십시오');</script>"; |
|
23 |
+ echo "<meta http-equiv='refresh' content='0.1; url=../index.php'>"; |
|
24 |
+ } |
|
25 |
+ }else{ |
|
26 |
+ echo "<script>alert('회원정보를 확인하십시오');</script>"; |
|
27 |
+ echo "<meta http-equiv='refresh' content='0.1; url=../index.php'>"; |
|
28 |
+ } |
|
29 |
+ }else{ |
|
30 |
+ echo "<script>alert('회원정보를 확인하십시오');</script>"; |
|
31 |
+ echo "<meta http-equiv='refresh' content='0.1; url=../index.php'>"; |
|
32 |
+ }(No newline at end of file) |
+++ config/signUpBack.php
... | ... | @@ -0,0 +1,30 @@ |
1 | +<?php | |
2 | + /** | |
3 | + * @var $mysqli | |
4 | + */ | |
5 | + ini_set('display_errors', '1'); | |
6 | + include("db.config.php"); | |
7 | + | |
8 | + /* posted information */ | |
9 | + $id = $_POST['id']; | |
10 | + $pw = $_POST['pw']; | |
11 | + $pwConfirm = $_POST['pwConfirm']; | |
12 | + | |
13 | + if($id != null && $pw != null){ /* 빈칸 예외처리 */ | |
14 | + if($pw == $pwConfirm){ /* 비밀번호 불일치 예외처리 */ | |
15 | + $query = "insert into login(id, pw) values('$id', '$pw')"; | |
16 | + if($query){ | |
17 | + $result = $mysqli->query($query); | |
18 | + echo "<script>alert('회원가입이 완료되었습니다.');</script>"; | |
19 | + echo "<meta http-equiv='refresh' content='0.1; url=../index.php'>"; | |
20 | + }else{ | |
21 | + echo "FAIL"; | |
22 | + } | |
23 | + }else{ | |
24 | + echo "<script>alert('비밀번호가 일치하지 않습니다.');</script>"; | |
25 | + echo "<meta http-equiv='refresh' content='0.1; url=../signUpFront.php'>"; | |
26 | + } | |
27 | + }else{ | |
28 | + echo "<script>alert('빈칸이 존재합니다.');</script>"; | |
29 | + echo "<meta http-equiv='refresh' content='0.1; url=../signUpFront.php'>"; | |
30 | + }(No newline at end of file) |
--- index.php
+++ index.php
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 |
</p> |
39 | 39 |
<div id="btnBox"> |
40 | 40 |
<input class="btn" type="submit" value="Sign In" onclick="form.action='config/signIn.php';"/> |
41 |
- <input class="btn" type="submit" value="Sign Up" onclick="form.action='signUp.php';"/> |
|
41 |
+ <input class="btn" type="submit" value="Sign Up" onclick="form.action='signUpFront.php';"/> |
|
42 | 42 |
</div> |
43 | 43 |
</form> |
44 | 44 |
</body> |
--- main.php
+++ main.php
... | ... | @@ -15,6 +15,9 @@ |
15 | 15 |
*/ |
16 | 16 |
ini_set("display_errors", 1); |
17 | 17 |
include("config/select.php"); |
18 |
+if(!preg_match("/".$_SERVER['HTTP_HOST']."/i",$_SERVER['HTTP_REFERER'])){ |
|
19 |
+ exit('Access Diny!!'); |
|
20 |
+} |
|
18 | 21 |
?> |
19 | 22 |
<!doctype html> |
20 | 23 |
<html lang="ko"> |
--- signUp.php
... | ... | @@ -1,1 +0,0 @@ |
1 | -<?php |
+++ signUpFront.php
... | ... | @@ -0,0 +1,48 @@ |
1 | +<?php | |
2 | +/** | |
3 | + * @var $connStatus | |
4 | + */ | |
5 | + ini_set("display_errors", 1); | |
6 | + include("config/db.config.php"); | |
7 | +?> | |
8 | +<!doctype html> | |
9 | +<html lang="ko"> | |
10 | +<head> | |
11 | + <meta charset="UTF-8"> | |
12 | + <meta name="viewport" | |
13 | + content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
14 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
15 | + <title>BoardSignUp</title> | |
16 | + <style> | |
17 | + #page {width: 360px; height: 180px; background-color: antiquewhite; margin: 0 auto; position: absolute; top: 30%; left: 38%;} | |
18 | + #title {text-align: center; font-size: larger; padding-top: 20px;} | |
19 | + #inputID {display: inline; padding-left: 20%;} | |
20 | + #inputPW {display: inline; padding-left: 17.7%;} | |
21 | + #inputPW_Confirm {display: inline;} | |
22 | + .text {height: 15px;} | |
23 | + #btnBox {text-align: center; padding-top: 30px;} | |
24 | + .btn {font-weight: bolder; background-color: darkslategrey; border-style: none; color: white; height: 30px; width: 65px;} | |
25 | + .btn:hover {background-color: black;} | |
26 | + </style> | |
27 | +</head> | |
28 | +<body> | |
29 | +<div id="conn"> | |
30 | + <?php echo $connStatus; ?> <!-- DB 연결 상태 표시 --> | |
31 | +</div> | |
32 | +<form id="page" method="post"> | |
33 | + <div id="title"><strong>SignUp</strong></div> | |
34 | + <p id="inputID"> | |
35 | + ID : <input class="text" type="text" name="id"><br> | |
36 | + </p> | |
37 | + <p id="inputPW"> | |
38 | + PW : <input class="text" type="password" name="pw"><br> | |
39 | + </p> | |
40 | + <p id="inputPW_Confirm"> | |
41 | + PW_Confirm : <input class="text" type="password" name="pwConfirm"><br> | |
42 | + </p> | |
43 | + <div id="btnBox"> | |
44 | + <input class="btn" type="submit" value="Done" onclick="form.action='config/signUpBack.php';"/> | |
45 | + <input class="btn" type="submit" value="Cancel" onclick="form.action='index.php';"/> | |
46 | + </div> | |
47 | +</form> | |
48 | +</body> |
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?