-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwithdraw.php
More file actions
80 lines (64 loc) · 2.04 KB
/
withdraw.php
File metadata and controls
80 lines (64 loc) · 2.04 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
<?php
require('function.php');
debug('「「「「「「「「「「「「「「「「「「');
debug('退会ページ');
debug('「「「「「「「「「「「「「「「「「「');
debugLogstart();
require('auth.php');
if(!empty($_POST)){
debug('POST送信があります');
try{
$dbh = dbConnect();
$sql1 = 'UPDATE users SET delete_flg = 1 WHERE id = :u_id';
$sql2 = 'UPDATE to_do SET delete_flg = 1 WHERE user_id = :u_id';
$data = array(':u_id' => $_SESSION['user_id']);
$stmt1 = queryPost($dbh, $sql1, $data);
$stmt2 = queryPost($dbh, $sql2, $data);
if($stmt1){
debug('退会します');
// session削除
$_SESSION = array();
if(isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time() - 42000, '/');
}
session_destroy();
debug('会員登録ページへ遷移します');
header('Location:signup.php');
}else{
$err_msg['common'] = MSG07;
}
}catch(Exception $e){
error_log('エラー発生:'.$e->getMessage());
$err_msg['common'] = MSG07;
}
}
?>
<?php
$title = '退会';
require('head.php');
?>
<body>
<?php
require('header.php');
?>
<div id="main" class="site-width">
<section class="form-container">
<div class="area-msg">
<?php
if(!empty($err_msg['common'])) echo $err_msg['common'];
?>
</div>
<h1 class="title">退会</h1>
<form class="form" action="" method="post">
<div class="btn-container" id="btn-withdraw">
<input type="submit" name="submit" value="退会する">
</div>
</form>
<div style="font-size: 22px; margin-top: 90px;">
<a href="to-do-view.php">todolist <i class="fas fa-angle-double-right"></i></a>
</div>
</section>
</div>
<?php
require('footer.php');
?>