-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddNewAgeLimitProcess.php
61 lines (48 loc) · 1.86 KB
/
addNewAgeLimitProcess.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
<?php
session_start();
require "connection.php";
require "SMTP.php";
require "PHPMailer.php";
require "Exception.php";
use PHPMailer\PHPMailer\PHPMailer;
if (isset($_POST["email"]) && isset($_POST["limit"])) {
if ($_SESSION["au"]["email"] == $_POST["email"]) {
$limit = $_POST["limit"];
$name = $_POST["name"];
$umail = $_POST["email"];
$category_rs = Database::search("SELECT * FROM `agelimit` WHERE `limit` LIKE '%" .$limit. "%'" );
$category_num = $category_rs->num_rows;
if ($category_num == 0) {
$code = uniqid();
Database::iud("UPDATE `admin` SET `verification_code`='" . $code . "' WHERE `email`='" . $umail . "'");
// EMAIL CODE
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'igamesinfos@gmail.com';
$mail->Password = 'cwjv xedp ajir oysq';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->setFrom('igamesinfos@gmail.com', 'Admin Verification');
$mail->addReplyTo('igamesinfos@gmail.com', 'Admin Verification');
$mail->addAddress($umail);
$mail->isHTML(true);
$mail->Subject = 'Infinity Games Admin Verification for Add New Age Limt';
$bodyContent = '<h1 style="color:blck;">Your verification code is <br> <span style="color:blue;"> '.$code.' </span></h1>';
$mail->Body = $bodyContent;
if (!$mail->send()) {
echo 'Verification code sending failed';
} else {
echo 'Success';
}
// EMAIL CODE
} else {
echo ("This Category Already Exists");
}
} else {
echo ("Invalid User");
}
} else {
echo ("Something Missing");
}