-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminVerificationProcess.php
More file actions
62 lines (48 loc) · 2.35 KB
/
adminVerificationProcess.php
File metadata and controls
62 lines (48 loc) · 2.35 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
<?php
include "connection.php";
require "SMTP.php";
require "PHPMailer.php";
require "Exception.php";
use PHPMailer\PHPMailer\PHPMailer;
if (isset($_POST["e"])) {
$email = $_POST["e"];
$admin_rs = Database::search("SELECT * FROM `admin` WHERE `email`='" . $email . "'");
$admin_num = $admin_rs->num_rows;
if ($admin_num > 0) {
$code = substr(uniqid(), -6);
Database::iud("UPDATE `admin` SET `vcode`='" . $code . "' WHERE `email`='" . $email . "'");
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'developer.thehan@gmail.com';
$mail->Password = 'bzlrdwwdyoxfsgol';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->setFrom('developer.thehan@gmail.com', 'Admin Verification');
$mail->addReplyTo('developer.thehan@gmail.com', 'Admin Verification');
$mail->addAddress($email);
$mail->isHTML(true);
$mail->Subject = 'Your Amazon Admin verification code';
$bodyContent = '<div style="background-color: #ffff; max-width: 600px;margin: 50px auto;padding: 20px;box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);border-radius: 8px;">
<img src="https://www.amazon.com/ref=nav_logo" alt="Embedded Image">
<h2 style="color: #000000;text-align: center;font-weight: bold;font-size: 24px;">Amazon Admin Verification Code</h2>
<hr/><br/>
<p style="color: #000000;line-height: 1.6; font-weight: bold;">Hi,<a>' . $email . '</a></p><br/>
<p style="color: #000000;line-height: 1.6; font-weight: bold; font-size: 14px;">Please enter the 6-digit code below on the email verification page: <span style="font-size: 24px; font-weight: bold;color: #f48024;">' . $code . '</span> Remember, beware of scams and keep this one-time verification code confidential.</p>
<p style="color: red;">If you did\'t request to Adminverificatin for amazon.lk, please ignore this email</p>
<p style="color: #909090;line-height: 1.6;">Thanks,<br>The Amazon Team</p>
</div>';
$mail->Body = $bodyContent;
if (!$mail->send()) {
echo 'Verification code sending failed.';
} else {
echo 'Success';
}
} else {
echo ("You are not a valid user.");
}
} else {
echo ("Email field should not be empty.");
}
?>