-
Notifications
You must be signed in to change notification settings - Fork 1
/
emailconfirm.php
executable file
·165 lines (130 loc) · 5.27 KB
/
emailconfirm.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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?php require_once("includes/session.php");?>
<?php require_once("includes/db_connection.php");?>
<?php require_once("includes/functions.php");?>
<?php
$username = $_GET['username'];
$code = $_GET['code'];
if(isset($_GET['username'])&&isset($_GET['code']))
{
$query = "SELECT * FROM users WHERE username = '{$username}'";
$result = mysqli_query($conn, $query);
confirm_query($result);
while ($row = mysqli_fetch_assoc($result)) {
$db_code = $row['confirm_code'];
$ectstamp= $row['ectstamp'];
$confirmed=$row['confirmed'];
}
$time=time();
if(($ectstamp+1800)<$time)
{
if($confirmed==0)
{
$query_delete="DELETE FROM users WHERE username='{$username}' LIMIT 1";
$result_delete=mysqli_query($conn,$query_delete);
}
redirect_to("linkexpire.php");
}
}
?>
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Cambuzz</title>
<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Custom Fonts -->
<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<!-- Animate CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.4.0/animate.min.css" type="text/css">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/creative.css" type="text/css">
<link rel="stylesheet" src="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" />
<link rel="stylesheet" type="text/css" href="css/background.css" />
<link rel="stylesheet" type="text/css" href="css/buttoncreatebuzz.css">
<script src="js/modernizr.custom.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
</head>
<body id="page-top">
<ul class="cb-slideshow">
<li><span>Image 01</span>
</li>
<li><span>Image 02</span>
</li>
<li><span>Image 03</span>
</li>
<li><span>Image 04</span>
</li>
<li><span>Image 05</span>
</li>
<li><span>Image 06</span>
</li>
</ul>
<header>
<div class="header-content">
<div class="header-content-inner">
<div class="heading-text animated fadeInUp">cambu<span class="animated tada">zz</span></div>
<p class="animated fadeInUp"><span style="font-size: 20px;"># </span>VITC Chapter</p>
</div>
</div>
<form id="confirmform">
<input type="text" style="display:none;" id="username" value="<?php echo $username; ?>">
<input type="text" style="display:none;" id="code" value="<?php echo $code; ?>">
<div class="mockup-content">
<div class="morph-button morph-button-modal morph-button-modal-2 morph-button-fixed login">
<button type="submit" style="color: white; background-color: #e75854;">Click to verify</button>
</div>
<!-- Sign Up Button -->
<!-- morph-button -->
</div>
</form>
</header>
<script src="https://cdnjs.cloudflare.com/ajax/libs/classie/1.0.1/classie.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/uiMorphingButton_fixed.js"></script>
<script type="text/javascript">
</script>
<script src="HTTP://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#confirmform').on('submit',function()
{
//var content=$("."+qid).html();
//alert(content);
//alert(qid);
//alert($(this).children(".questioncontent"));
var username=$("#username").val();
var code=$("#code").val();
//$("#"+qid).val(content);
//alert('hello');
$.ajax({
method: "POST",
url: "emailconfirm1.php",
data: {username:username,code:code}
})
.done(function(msg){
//$('#modal-1').modal('hide');
//$('body').removeClass('modal-open');
//$(".modal-backdrop").remove();
//$("#"+qid).val(content);
window.location.href="index.php";
});
return false;
});
});
</script>
</body>
</html>
<?php
if (isset ($conn)){
mysqli_close($conn);
}
?>