-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify.php
33 lines (28 loc) · 1013 Bytes
/
verify.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
<?php
require_once "DB_Functions.php";
$db = new DB_Functions();
// json response array
$response = array("error" => FALSE);
// check if email and verification_code was passed through POST method
if (isset($_GET['e']) && isset($_GET['c']))
{
$email = $_GET["e"];
$codice = $_GET["c"];
$result = $db->accountVerification($email, $codice);
switch ($result) {
case 1:
$response["error"] = true;
$response["error_msg"] = "Si è verificato un errore imprevisto durante la verifica dell'account.";
break;
case 2:
$response["error"] = true;
$response["error_msg"] = "L'account è già stato verificato.";
break;
}
} else {
// required post params is missing
$response["error"] = TRUE;
$response["error_msg"] = "I parametri richiesti sono obbligatori";
}
echo json_encode($response);
?>