buongiorno
lo prendo da qui
$user = ($_POST ['user']);
questo è il codice
Codice PHP:
<?php
session_start ();
require_once('dbconnection.php');
if (isset ( $_SESSION ['user'] ) != "") {
header ( "Location: calendario.php" );//calendario.php
}
if (isset ( $_POST ['login'] )) {
$user = ($_POST ['user']);
$upass = md5 ( $_POST ['pass'] );
/*$sql = "select * from utente where Nickname= :utente";
$stmt = $db->prepare ( $sql );
$stmt->bindParam ( ':utente', $user );
$stmt->execute ();
$obj = $stmt->fetchObject ();*/
$obj= utente($user);
if ($obj->Password == ($upass)) {
$_SESSION ['user'] = $obj->Codice;
$_SESSION['start'] = time();
$_SESSION['expire'] = $_SESSION['start'] + (30 * 60);
header ( "Location: calendario.php" );
} else {
?>