-
Notifications
You must be signed in to change notification settings - Fork 0
/
ikinci.php
177 lines (143 loc) · 7.33 KB
/
ikinci.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
166
167
168
169
170
171
172
173
174
175
176
177
<?php session_start();
try {
$baglanti = new PDO("mysql:host=localhost;dbname=maildogrulama;charset=utf8","root","");
$baglanti->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $e) {
die($e->getMessage());
}
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMAİLLER/src/Exception.php';
require 'PHPMAİLLER/src/PHPMailer.php';
require 'PHPMAİLLER/src/SMTP.php';
$mail = new PHPMailer(true);
if(isset($_POST["mail"]) && $_POST["mail"]!=""):
$kodumuz= substr(md5(mt_rand(0,99999)),2,6);
try {
//Server settings
$mail->SMTPDebug =0; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'bonusgafa.xyz'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = '[email protected]'; //SMTP username
$mail->Password = 'TAHAtuna5319*'; //SMTP password
$mail->SMTPSecure = 'ssl'; //Enable implicit TLS encryption
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//To load the French version
$mail->setLanguage('tr','PHPMAİLLER/language/');
$mail->CharSet='UTF-8';
//Recipients
$mail->setFrom($mail->Username, 'Mail Doğrulama Sistemi');
$mail->addAddress(htmlspecialchars($_POST["mail"])); //Name is optional
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'ÜYELİK AKTİVASYON';
//$mail->Body = '<b>DOĞRULAMA KODU:</b>'.$kodumuz.'<br><br><br>Üyeliğinizi aktif edin, fırsatlardan yararlanın'; //farklı sayfaya gitmeden doğrulama kodu
$mail->Body = '<b>DOĞRULAMA Linki:</b> http://localhost/maildogrulamabaslangic/maildogrulama.php?guvenlikkodu='.$kodumuz; //farklı sayfada doğrulama kodu girme
$mail->send();
$sifreSifrelendi=md5(@$_POST["sifre"]);
$ekleme=$baglanti->prepare("INSERT INTO uyeler(ad,sifre,mail,dogrulama) VALUES(?,?,?,?)");
$ekleme->execute(array(
$_POST["username"],
$sifreSifrelendi,
$_POST["mail"],
$kodumuz
));
}
catch (Exception $e) {
}
endif;
?>
<!DOCTYPE html>
<html lang="tr">
<head>
<title>MAİL DOĞRULAMA</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/iconic/css/material-design-iconic-font.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!--===============================================================================================-->
</head>
<body>
<div class="limiter">
<div class="container-login100" style="background-image: url('images/bg-01.jpg');">
<div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
<?php
if (isset($_POST["dogkod"])):
$gelenkod=$_POST["dogkod"];
$kontrolet=$baglanti->prepare("SELECT * FROM uyeler WHERE dogrulama='".$gelenkod."'");
$kontrolet->execute();
if($kontrolet->rowCount()>0):
$uyebilgisi=$kontrolet->fetch();
//echo $uyebilgisi["ad"]."<br>";
$baglanti->query("UPDATE uyeler SET durum=1 WHERE id=".$uyebilgisi["id"]);
echo '<div class="alert alert-success">'.$uyebilgisi["ad"].'<br>Üyeliğiniz Başarıyla Aktifleştirildi </div>';
else:
echo "yok";
endif;
// MAİL İLE GELEN KODU BURADA KONTROL EDECEĞİZ
else:
?>
<form class="login100-form validate-form" method="post" action="ikinci.php">
<span class="login100-form-title p-b-49">
DOĞRULAMA KODU KONTROLÜ
</span>
<div class="wrap-input100 validate-input m-b-23" data-validate = "Doğrulama Kodu zorunludur">
<span class="label-input100">Doğrulama Kodu</span>
<input class="input100" type="text" name="dogkod" placeholder="Doğrulama Kodunu giriniz">
<span class="focus-input100" data-symbol=""></span>
</div>
<div class="container-login100-form-btn mt-3">
<div class="wrap-login100-form-btn">
<div class="login100-form-bgbtn"></div>
<button class="login100-form-btn" type="submit">
Tamam
</button>
</div>
</div>
</form>
<?php
endif;
?>
</div>
</div>
</div>
<div id="dropDownSelect1"></div>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/animsition/js/animsition.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/daterangepicker/moment.min.js"></script>
<script src="vendor/daterangepicker/daterangepicker.js"></script>
<!--===============================================================================================-->
<script src="vendor/countdowntime/countdowntime.js"></script>
<!--===============================================================================================-->
<script src="js/main.js"></script>
</body>
</html>