include("config/config.php"); session_start(); if (isset($_GET['page'])) { //LOGOUT if ($_GET['page'] == "logout") { session_unset(); session_destroy(); header("Location:index.php"); } } //connessione $link = mysql_connect($localhost,$db_user,$db_pass); if (!$link) die ("Impossibile connettersi a MySQL"); mysql_select_db($db_name,$link) or die ("Impossibile aprire $db_name: ".mysql_error()." Contattare immediatamente mailto:$sistema "); //fine connessione //CONTROLLO SE USERNAME E PASSWORD SONO CORRETTI E NEL CASO APRO LA SESSIONE E VADO NELL'AREA CLIENTI if (isset($_POST['Submit'])) { if ($_POST['Submit'] == "Entra") { $pwd_sb="passwd_sbagliata.php"; include("include/func_controllo_login.php"); //VARIABILI PASSATE: username, password,tabella,destinazione se username e password sono OK func_creazione_password($_POST['username'],$_POST['password'],"utenti","areac/index.php"); } } //FINE CONTROLLO PASSWORD //Serve per caricare i dati del cliente e il nome da stampare sul lato destro if (isset($_SESSION['login']) && $_SESSION['login']==true) { $query = " SELECT * FROM utenti WHERE id ='".$_SESSION['id']."' "; $result = mysql_query($query,$link) or die ("Impossibile leggere da utenti".mysql_error() ); $dati_cliente = mysql_fetch_array($result); } //include("include/func_caratteri_stringa.php"); //include("include/func_data_da_timestamp.php"); ?>