-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessageReadAction.php
40 lines (35 loc) · 1.07 KB
/
messageReadAction.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
<?php
session_start();
if($_SESSION['user_name'] === null){
header('location: sign.php');
}
require 'userDAO.php';
require 'messageDAO.php';
$userDAO = new userDAO();
$messageDAO = new messageDAO();
$message_seq = $_GET['messageSeq'];
$user_name = $_SESSION['user_name'];
$user_email = $userDAO->get_userEmail($user_name);
$qualification = $messageDAO->messageAccessCheck($message_seq, $user_email, $user_name);
if($qualification){
$result = $messageDAO->read_Message($message_seq);
$row = mysqli_fetch_assoc($result);
$_SESSION['readingTarget'] = $row;
header('location: messageRead.php');
}else{
$_SESSION['messageAccessWrong'] = 'NO_QUALIFICATION';
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">
<title>Message Box</title>
</head>
<body>
<?php echo($row['title']); ?>
</body>
</html>