-
Notifications
You must be signed in to change notification settings - Fork 0
/
modifyInfo.php
52 lines (52 loc) · 2.92 KB
/
modifyInfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!-- Session Data를 사용하려면 session_start() 필수 -->
<?php session_start(); ?>
<?php require 'userDAO.php'; ?>
<!-- 이 부분에 session이 없으면 접근 차단하는 코드 작성 필요 -->
<?php
if($_SESSION['user_name'] == null){
header('location: sign.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./assets/css/modifyInfo.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<title>정보 수정</title>
</head>
<body>
<div id="form">
<div id="back"><a href="./home.php"><<</a></div>
<h1 style="font-style : normal;">정보 수정</h1><br>
<form id="modify_form" method="POST" action="./modifyAction.php">
<h3>이름 : <?php $userDAO = new userDAO(); echo($userDAO->get_userName($userDAO->get_userEmail($_SESSION['user_name']))) ?></h3>
<h3>E-mail : <?php $userDAO = new userDAO(); echo($userDAO->get_userEmail($_SESSION['user_name'])) ?></h3>
<h3>Nickname : <input class="input" type="text" value="<?php $userDAO = new userDAO(); echo($userDAO->get_userNick($userDAO->get_userEmail($_SESSION['user_name']))) ?>" name="nick"></h3>
<h3>친구 추가를 위한 검색 허용 : 허용
<?php
if($userDAO->get_searchYN($_SESSION['user_name']) === 'N'){
echo('<input type="radio" name="search_YN" value="Y"> 거부 <input type="radio" name="search_YN" value="N" checked="checked">');
}else{
echo('<input type="radio" name="search_YN" value="Y" checked="checked"> 거부 <input type="radio" name="search_YN" value="N">');
}
?>
</h3>
<h3>Password : <input class="input" type="password" name="pass"></h3>
<h3>Password Check : <input class="input" type="password" name="passck"></h3><br><br>
<?php
if($_GET['error'] == 1) {
echo '<h4>Your nickname is too long!</h4>'; echo '<h4>English is up to 20 characters, Korean is up to 6 characters.</h4>';
}else if($_GET['error'] == 2) {
echo '<h4>Password is incorrect.</h4>';
}else if($_GET['success'] == 1) {
echo '<h2>Data was updated successfully!</h2>';
}
?>
<input class="apply" type="submit" value="Apply">
</form>
</div>
</body>
</html>