This repository was archived by the owner on Jul 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·48 lines (44 loc) · 1.33 KB
/
Copy pathindex.php
File metadata and controls
executable file
·48 lines (44 loc) · 1.33 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
<?php
require("./comuni/lib.php");
dbconnect();
session_start(); // inizializzo la sessione
if (isset($_SESSION["id"]) && ($_SESSION["id"]!=0))
{
/* se l'utente è già loggato viene reindirizzato per continuare la sua sessione */
header('Location: comuni/loggato.php');
}
if (isset($_POST["submit"]) && ($_POST["submit"]=="ENTRA"))
{
if(!(isset($_REQUEST['jscheck']) && $_REQUEST['jscheck']=="yes"))
{
?>
Devi abilitare Javascript per visualizzare questo sito!
<a href="./login.php" >Clicca qui per tornare alla pagina di login</a>
<?php
exit();
}
$username=trim(addslashes($_POST["login"])); /* evito SQL-Injection */
$password=trim(addslashes($_POST["password"]));
$id=login($username,$password);
if($id<0)
{//allora ho un errore
//login_error($id);
//login_form();
//require("./login.php?e=".$id);
header('Location: login.php?e='.$id);
}
else
{
//login effettuato
$_SESSION["login"]=$username;
$_SESSION["id"]=$id;
$_SESSION["priv"]=id_to_priv($id);
// $_SESSION["saldo"]=id_to_saldo($id);
// echo "sei ".$login;
header('Location: ./comuni/loggato.php');
}
}
else
require("./login.php");
//login_form();
?>