-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage_inputlogsign.php
More file actions
35 lines (31 loc) · 818 Bytes
/
page_inputlogsign.php
File metadata and controls
35 lines (31 loc) · 818 Bytes
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
<?php
$session = true;
if( session_status() === PHP_SESSION_DISABLED ){
$session = false;
}
else if( session_status() !== PHP_SESSION_ACTIVE ){
session_start();
}
include 'f_connectionDB.php';
include 'f_logorsign.php';
$con = getConnectionDB();
$log = checkLoginDB($con);
$sign = checkRegisterDB($con);
echo "log ".$log.", signup".$sign;
if ($log==true || $sign==true){
$redirect="posti.php";
header('Location: '.$redirect);
exit();
} else {
$redirect="index.php";
$msg="";
if ($log==false){
$msg="Login errato. Username/password errati.";
} else if ($sign==false){
$msg="Registrazione non andata a buon fine. Parametri errati o username già presente nel database.";
}
header('Location: '.$redirect.'?msg='.$msg);
exit();
}
mysqli_close($con);
?>