-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayError.php
57 lines (57 loc) · 2.16 KB
/
displayError.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
<?php
if (isset($_SESSION["userId"])) { # ciò che vedi durante login
if (isset($_GET["error"])) {
switch ($_GET["error"]) {
case "sql":
echo 'There was an error during the interaction with the db.';
break;
}
}
if (isset($_GET["success"])) {
switch ($_GET["success"]) {
case "changePwd":
echo 'There password was updated';
break;
case "login":
echo 'You are logged in as ' . $_SESSION["userName"] . ', by your e-mail ' . $_SESSION["userMail"];
break;
case "delete":
echo 'Your profile image was deleted successfully.';
break;
}
}
} else if (!isset($_SESSION["userId"])) { # ciò che vedi durante logout
if (isset($_GET["logout"])) {
switch ($_GET["logout"]) {
case "success":
echo 'Thank for using me. See you soon!';
break;
}
}
if (isset($_GET["error"])) {
switch ($_GET["error"]) {
case "login":
echo 'The username or the password was wrong.';
break;
case "sql":
echo 'There was a problem during the interaction with db.';
exit();
case "emptyFields":
echo 'You should fill the login form in order to login.';
exit();
case "userOrIdNotFound":
echo 'This username is not present inside the db.';
exit();
case "wrongData":
echo 'I do not recognize the username or the password.';
exit();
case "goAway":
echo 'You tried to reach a page from the URL.';
exit();
case "deleteDefault":
echo 'You are not allowed to delete the default profile image.';
exit();
}
}
}
?>