-
-
News
-
Article heading goes here
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Similique delectus ab doloremque, qui doloribus ea officiis...
-
- Read more
-
-
+
+
+
+
+
Get in touch
+
We'd love to hear from you
+
+
+
diff --git a/webPage/Sign-up.php b/webPage/Sign-up.php
new file mode 100644
index 0000000..099b95b
--- /dev/null
+++ b/webPage/Sign-up.php
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
Modern Business - Start Bootstrap Template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/webPage/checkId_ok.php b/webPage/checkId_ok.php
new file mode 100644
index 0000000..a81f617
--- /dev/null
+++ b/webPage/checkId_ok.php
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/webPage/config/db_connect.php b/webPage/config/db_connect.php
new file mode 100644
index 0000000..a165249
--- /dev/null
+++ b/webPage/config/db_connect.php
@@ -0,0 +1,18 @@
+conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
+
+ // return database handler
+ return $this->conn;
+ }
+}
+
+?>
diff --git a/webPage/config/db_functions.php b/webPage/config/db_functions.php
new file mode 100644
index 0000000..23737aa
--- /dev/null
+++ b/webPage/config/db_functions.php
@@ -0,0 +1,116 @@
+conn = $db->connect();
+ }
+
+ // destructor
+ function __destruct() {
+
+ }
+
+ // 회원 정보 신규 입력
+ public function storeUser($PID, $PPW, $LikeStyle, $Age, $Gender) {
+ $hash = $this->hashSSHA($PPW);
+ $encrypted_password = $hash['encrypted']; // encrypted password
+
+ $stmt = $this->conn->prepare("INSERT INTO users(Age, LikeStyle, Gender, PID, PPW ) VALUES(?, ?, ?, ?, ? )");
+
+ $stmt->bind_param('issss', $Age, $LikeStyle, $Gender, $PID, $encrypted_password);
+
+ $result = $stmt->execute();
+ $stmt->close();
+
+ // check for successful store
+ if ($result) {
+ $stmt = $this->conn->prepare("SELECT * FROM users WHERE PID = ?");
+ $stmt->bind_param("s", $PID);
+ $stmt->execute();
+ $user = $stmt->get_result()->fetch_assoc();
+ $stmt->close();
+
+ return $user;
+ } else {
+ return false;
+ }
+ }
+
+ // 로그인 체크
+ public function getUser($userID, $password) {
+ $stmt = $this->conn->prepare("SELECT * FROM members WHERE userID = ?");
+ $stmt->bind_param("s", $userID);
+
+ if ($stmt->execute()) {
+ $user = $stmt->get_result()->fetch_assoc();
+ $stmt->close();
+
+ // verifying user password
+ $salt = $user['salt'];
+ $encrypted_password = $user['passwd'];
+ $hash = $this->checkhashSSHA($salt, $password);
+ // check for password equality
+ if ($encrypted_password == $hash) {
+ // user authentication details are correct
+ return $user;
+ }
+ } else {
+ return NULL;
+ }
+ }
+
+ // 회원 가입 여부 체크
+ public function isUserExisted($userID) {
+ $stmt = $this->conn->prepare("SELECT PID from users WHERE PID = ?");
+
+ $stmt->bind_param("s", $userID);
+ $stmt->execute();
+ //$stmt->store_result();
+ $result = $stmt->get_result();
+
+ if ($result->num_rows > 0) {
+ // user existed
+ $stmt->free_result();
+ $stmt->close();
+ return true;
+ } else {
+ // user not existed
+ $stmt->free_result();
+ $stmt->close();
+ return false;
+ }
+ }
+
+ // 회원 정보 삭제
+ public function deleteUser($userID){
+ $stmt = $this->conn->prepare("delete FROM users WHERE PID = ?");
+ $stmt->bind_param("s", $userID);
+ $stmt->execute();
+ $stmt->close();
+ }
+
+ public function hashSSHA($password) {
+
+ $salt = sha1(rand());
+ $salt = substr($salt, 0, 10);
+ $encrypted = base64_encode(sha1($password . $salt, true) . $salt);
+ $hash = array("salt" => $salt, "encrypted" => $encrypted);
+ return $hash;
+ }
+
+ public function checkhashSSHA($salt, $password) {
+ $hash = base64_encode(sha1($password . $salt, true) . $salt);
+ return $hash;
+ }
+
+}
+
+?>
diff --git a/webPage/css/styleOwn.css b/webPage/css/styleOwn.css
new file mode 100644
index 0000000..eff770e
--- /dev/null
+++ b/webPage/css/styleOwn.css
@@ -0,0 +1,140 @@
+@import url('https://fonts.googleapis.com/css?family=Noto+Sans+KR&display=swap');
+
+*{margin:0; padding: 0; box-sizing: border-box;}
+body{
+
+}
+body::before{
+
+}
+
+.login-form {position: relative; z-index:2;
+ background: rgba(17, 9, 20, 0.959);
+ margin-top: 20px;
+ margin-bottom: auto;
+
+}
+.login-form h1{
+ font-size: 32px; color: rgb(247, 247, 248);
+ text-align: center;
+ margin-bottom: 60px;
+ margin-top : 30px;
+
+}
+
+.int-area {width: 400px; margin-left: 10%;}
+.int-area input{
+ width: 120%;
+ padding: 20px 10px 10px;
+ background-color: transparent;
+ border: none;
+ border-bottom: 1px solid #999;
+ font-size: 18px; color: #fff;
+ outline: none;
+
+}
+.int-area button{
+ position: relative;
+ top: -2px;
+ width: 50px;
+ margin-left: 0;
+ padding-left: 0;
+ border: 0;
+ box-sizing:content-box;
+ background: linear-gradient(to left, #f857a6, #ff5858);
+ font-size: 12px;
+ font-weight: bold;
+ color: #fff;
+ cursor: pointer;
+}
+.int-area p{
+ display: none;
+}
+.int-area label {
+ position:relative; left:10px; bottom: 30px;
+ font-size: 18px; color: #999;
+ transition: top .5 ease;
+}
+.int-area input:focus + label,
+.int-area input:valid + label{
+ bottom: 70px;
+ font-size: 15px,; color: #166cea;
+}
+
+.btn-area {margin-top: 30px;}
+.btn-area button{
+ width: 60%; height: 50px;
+ background: #166cea;
+ color: #fff;
+ position: relative;
+ top: 50%;
+ left: 15%;
+ font-size: 20px;
+ border: none;
+ border-radius: 25px;
+ cursor:pointer;
+ margin-bottom: 20px;
+
+}
+
+.caption{
+ margin-top: 20px;
+ text-align: center;
+}
+.caption a{
+ font-size: 15px; color:#999;
+ text-decoration: none;
+}
+select {
+ -webkit-appearance:none;
+ -moz-appearance:none;
+ -ms-appearance:none;
+ appearance:none;
+ outline:0;
+ box-shadow:none;
+ border:0!important;
+ background: #999;
+ background-image: none;
+ flex: 1;
+ padding: 0 .5em;
+ color:#fff;
+ cursor:pointer;
+ font-size: 1em;
+ font-family: 'Open Sans', sans-serif;
+ }
+ select::-ms-expand {
+ display: none;
+ }
+ .select label {
+ position:relative; left:10px; bottom: 5px;
+ font-size: 18px; color: rgb(153, 153, 153);
+ width: 5em;
+ transition: top .5 ease;
+ }
+ .select {
+ position: relative;
+ display: flex;
+ width: 14em;
+ height: 3em;
+ line-height: 3;
+ background: rgba(0,0,0,0);
+ overflow: hidden;
+ border-radius: 0em;
+ margin-left: 10%;
+
+
+ }
+ .select::after {
+ content: '\25BC';
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 0 1em;
+ background: #bbc2c2;
+ cursor:pointer;
+ pointer-events:none;
+ transition:.25s all ease;
+ }
+ .select:hover::after {
+ color: #23b499;
+ }
diff --git a/webPage/faq.html b/webPage/faq.html
index 51da176..4d62d45 100644
--- a/webPage/faq.html
+++ b/webPage/faq.html
@@ -28,10 +28,10 @@
Pricing
FAQ
- Blog
+ Sign
diff --git a/webPage/js/resist.js b/webPage/js/resist.js
new file mode 100644
index 0000000..3945ea3
--- /dev/null
+++ b/webPage/js/resist.js
@@ -0,0 +1,115 @@
+const sendit = () => {
+ // Input들을 각각 변수에 대입
+ const userid = document.regiform.userid;
+ const userpw = document.regiform.userpw;
+ const userpw_ch = document.regiform.userpw_ch;
+ const userhobby = document.regiform.hobby;
+ // userid값이 비어있으면 실행.
+ if(userid.value == '') {
+ alert('아이디를 입력해주세요.');
+ userid.focus();
+ return false;
+ }
+ // userid값이 4자 이상 12자 이하를 벗어나면 실행.
+ if(userid.value.length < 4 || userid.value.length > 12){
+ alert("아이디는 4자 이상 12자 이하로 입력해주세요.");
+ userid.focus();
+ return false;
+ }
+ // userpw값이 비어있으면 실행.
+ if(userpw.value == '') {
+ alert('비밀번호를 입력해주세요.');
+ userpw.focus();
+ return false;
+ }
+ // userpw_ch값이 비어있으면 실행.
+ if(userpw_ch.value == '') {
+ alert('비밀번호 확인을 입력해주세요.');
+ userpw_ch.focus();
+ return false;
+ }
+ // userpw값이 6자 이상 20자 이하를 벗어나면 실행.
+ if(userpw.value.length < 6 || userpw.value.length > 20){
+ alert("비밀번호는 6자 이상 20자 이하로 입력해주세요.");
+ userpw.focus();
+ return false;
+ }
+ // userpw값과 userpw_ch값이 다르면 실행.
+ if(userpw.value != userpw_ch.value) {
+ alert('비밀번호가 다릅니다. 다시 입력해주세요.');
+ userpw_ch.focus();
+ return false;
+ }
+ // username값이 비어있으면 실행.
+ if(username.value == '') {
+ alert('이름을 입력해주세요.');
+ username.focus();
+ return false;
+ }
+ // 한글 이름 형식 정규식
+ const expNameText = /[가-힣]+$/;
+ // username값이 정규식에 부합한지 체크
+ if(!expNameText.test(username.value)){
+ alert("이름 형식이 맞지않습니다. 형식에 맞게 입력해주세요.");
+ username.focus();
+ return false;
+ }
+ // userhobby를 하나 이상 선택 시 체크할 flag 변수 지정
+ let flag = false;
+ // userhobby를 하나 이상 선택 시 flag값에 true 대입
+ for(let i=0; i < userhobby.length; i++) {
+ if(userhobby[i].checked) {
+ flag = true;
+ break;
+ }
+
+ }
+ // flag값이 false일 때(userhobby를 체크하지 않았을 때) 실행.
+ if(!flag){
+ alert("취미는 1개 이상 선택해주세요.");
+ return false;
+ }
+ // 유효성 검사 정상 통과 시 true 리턴 후 form 제출.
+ return true;
+}
+const checkId = () => {
+ // userid, result 변수에 대입
+ const userid = document.regiform.userid;
+ const result = document.querySelector('#result');
+
+ // 중복체크 시에 한번 더 userid 입력값 체크
+ if(userid.value == '') {
+ alert('아이디를 입력해주세요.');
+ userid.focus();
+ return false;
+ }
+ if(userid.value.length < 4 || userid.value.length > 12){
+ alert("아이디는 4자 이상 12자 이하로 입력해주세요.");
+ userid.focus();
+ return false;
+ }
+ const xhr = new XMLHttpRequest();
+xhr.onreadystatechange = () => {
+ if(xhr.readyState == XMLHttpRequest.DONE) {
+ if(xhr.status == 200) {
+ let txt = xhr.responseText.trim();
+ if(txt == "O") {
+ result.style.display = "block";
+ result.style.color = "green";
+ result.innerHTML = "사용할 수 있는 아이디입니다.";
+ } else {
+ result.style.display = "block";
+ result.style.color = "red";
+ result.innerHTML = "중복된 아이디입니다.";
+ userid.focus();
+ // 키 입력 시 result 숨김 이벤트
+ userid.addEventListener("keydown", function(){
+ result.style.display = "none";
+ });
+ }
+ }
+ }
+}
+xhr.open("GET", "checkId_ok.php?userid="+userid.value, true);
+xhr.send();
+}
\ No newline at end of file
diff --git a/webPage/js/scripts.js b/webPage/js/scripts.js
index 1046568..68e610d 100644
--- a/webPage/js/scripts.js
+++ b/webPage/js/scripts.js
@@ -149,4 +149,24 @@ function DropFile(dropAreaId, fileListId) {
};
}
- const dropFile = new DropFile("drop-file", "files");
\ No newline at end of file
+ //const dropFile = new DropFile("drop-file", "files");
+
+ // 로그인 구현 js
+ //
+
+function check_input()
+{
+ if(!document.loginSbmt.id.value)
+ {
+ alert("아이디를 입력하세요");
+ document.loginSbmt.id.focus();
+ return;
+ }
+
+ if(!document.loginSbmt.pass.value){
+ alert("비밀번호를 입력하세요");
+ document.loginSbmt.pass.focus();
+ return;
+ }
+ document.loginSbmt.submit();
+}
diff --git a/webPage/portfolio-overview.html b/webPage/portfolio-overview.html
index 2269b72..3d1870c 100644
--- a/webPage/portfolio-overview.html
+++ b/webPage/portfolio-overview.html
@@ -28,10 +28,10 @@
Pricing
FAQ
- Blog
+ Sign
diff --git a/webPage/pricing.html b/webPage/pricing.html
index 1ada4f3..24bec24 100644
--- a/webPage/pricing.html
+++ b/webPage/pricing.html
@@ -28,10 +28,10 @@
Pricing
FAQ
- Blog
+ Sign
diff --git a/webPage/register.php b/webPage/register.php
new file mode 100644
index 0000000..153b507
--- /dev/null
+++ b/webPage/register.php
@@ -0,0 +1,65 @@
+ FALSE);
+
+if (isset($_POST['userID']) && isset($_POST['Age']) && isset($_POST['Gender']) && isset($_POST['userpw']) && isset($_POST['LikeStyle'])) {
+
+ // POST 배열로 받은 데이터
+ $userID = $_POST['userID'];
+ $Age = $_POST['Age'];
+ $Gender = $_POST['Gender'];
+ $password = $_POST['userpw'];
+ $LikeStyle = $_POST['LikeStyle'];
+
+ // 동일한 userID 등록되어 있는지 체크
+ if ($db->isUserExisted($userID)) { // E-Mail 이 key value
+ // user already existed
+ $response["error"] = TRUE;
+ $response["error_msg"] = "User already existed with " . $userID;
+ echo json_encode($response);
+ } else {
+ // 사용자 등록
+
+ $user = $db->storeUser($userID, $password, $LikeStyle, $Age, $Gender );
+
+ if ($user) { // 사용자 등록 성공
+ //storeUser($PID, $PPW, $LikeStyle, $Age, $Gender)
+ $response['error'] = FALSE;
+ $response['users']['PID'] = $user['PID'];
+ $response['users']['PPW'] = $user['PPW'];
+ $response['users']['LikeStyle'] = $user['LikeStyle'];
+ $response['users']['Age'] = $user['Age'];
+ $response['users']['Gender'] = $user['Gender'];
+
+ echo json_encode($response);
+ } else {
+ // 사용자 등록 실패
+ $response['error'] = TRUE;
+ $response['error_msg'] = "Unknown error occurred in registration!";
+ echo json_encode($response);
+ }
+ }
+} else { // 입력받은 데이터에 문제가 있을 경우
+ $response['error'] = TRUE;
+ $response['error_msg'] = "Required parameters (name, email or password) is missing!";
+ echo json_encode($response);
+}
+?>
+