-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify.php
More file actions
48 lines (41 loc) · 1.77 KB
/
verify.php
File metadata and controls
48 lines (41 loc) · 1.77 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>모두의 클래스 > Sign up</title>
</head>
<body>
<!-- start header div -->
<div id="header">
<h3>모두의 클래스 > Sign up</h3>
</div>
<!-- end header div -->
<!-- start wrap div -->
<div id="wrap">
<!-- start PHP code -->
<?php
$con = mysqli_connect("localhost", "user1", "12345", "all_class"); // Connect to database server(localhost) with username and password.
if(isset($_GET['email']) && !empty($_GET['email']) AND isset($_GET['hash']) && !empty($_GET['hash'])){
// Verify data
$email = $_GET['email']; // Set email variable
$hash = $_GET['hash']; // Set hash variable
$sql = "SELECT email, hash, active FROM members WHERE email='".$email."' AND hash='".$hash."' AND active='0'";
$search = mysqli_query($con, $sql);
$match = mysqli_num_rows($search);
if($match){
$sql2 = "UPDATE members SET active='1' WHERE email='".$email."' AND hash='".$hash."' AND active='0'";
mysqli_query($con, $sql2);
echo "메일 인증이 완료되었습니다.<br>이제 로그인을 진행해주세요.";
}else{
echo "메일 인증에 실패했습니다. 이미 활성화된ㄴ 계정이거나 중복된 이메일 입니다.";
}
}else{
// Invalid approach
echo "잘못된 접근 방식입니다. 이메일로 전송 된 링크를 사용하십시오.";
}
?>
<!-- stop PHP Code -->
</div>
<!-- end wrap div -->
</body>
</html>