-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmypage_comment.php
More file actions
150 lines (137 loc) · 3.37 KB
/
mypage_comment.php
File metadata and controls
150 lines (137 loc) · 3.37 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
include_once 'db.php';
//$mysqli = new mysqli('localhost:3306','root','rootroot','events_calendar') or die(mysqli_error($mysqli));
error_reporting( E_ALL );
ini_set( "display_errors", 1 );
//$_SESSION['id'] = 1;
if(!isset($_SESSION['ID'])){
echo "<script>alert('로그인 하세요.');
history.back();</script>";
}
else {
$userID = $_SESSION['ID'];
}
?>
<style type="text/css">
#clicked{
padding-top: 1px;
padding-bottom: 1px;
text-align: center;
width: 100%;
background-color: #ecb21f;
border-color: #a88734 #9c7e31 #846a29;
color: black;
border-width: 1px;
border-style: solid;
border-radius: 13px;
}
#post{
margin: 10px;
padding: 6px;
padding-top: 2px;
padding-bottom: 2px;
text-align: center;
background-color: #ecb21f;
border-color: #a88734 #9c7e31 #846a29;
color: black;
border-width: 1px;
border-style: solid;
border-radius: 13px;
width: 50%;
}
body{
background-color: black;
}
.comments{
margin-top: 5%;
margin-left: 20px;
}
.darker{
border: 1px solid #ecb21f;
background-color: black;
float: right;
border-radius: 5px;
padding-left: 40px;
padding-right: 30px;
padding-top: 10px;
}
.comment{
border: 1px solid rgba(44, 65, 252, 1);
background-color: rgba(44, 65, 252, 0.973);
float: left;
border-radius: 5px;
padding-left: 40px;
padding-right: 30px;
padding-top: 10px;
padding-bottom: 10px;
margin-bottom: 10px;
}
.comment h4,.comment span,.darker h4,.darker span{
display: inline;
}
.comment p,.comment span,.darker p,.darker span{
color: rgb(184, 183, 183);
}
h1{
color:black;
font-weight: bold;
}
h4{
color: white;
font-weight: bold;
}
label{
color: rgb(212, 208, 208);
}
#align-form{
margin-top: 20px;
}
.form-group p a{
color: white;
}
.form-group input,.form-group textarea{
background-color: black;
border: 1px solid rgba(16, 46, 46, 1);
border-radius: 12px;
}
form{
border: 1px solid rgba(16, 46, 46, 1);
background-color: rgba(16, 46, 46, 0.973);
border-radius: 5px;
padding: 20px;
}
</style>
<!-- Main Body -->
<!DOCTYPE html>
<html lang="ko">
<header>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</header>
<body>
<section>
<?php
$sql = "(
SELECT content AS content FROM post WHERE id = '$userID'
UNION ALL
SELECT review AS content FROM review WHERE id = '$userID')";
$result = $conn->query($sql);
?>
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 pb-4">
<h1>Comments</h1>
<?php while($row = mysqli_fetch_array($result)){
?>
<div class="comment mt-4 text-justify float-left">
<p><?php echo $row['content']; ?></p>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<?php mysqli_close($conn);?>
</section>
</body>
</html>