SHARE
TWEET

Untitled

a guest Apr 9th, 2018 206 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $strMex = "Prego, immetti username e password per accedere alla tua area personale";
  4.     if (isset($_SESSION['utente']))
  5.         header('Location: PersonalArea.php');
  6.        
  7.     if (isset($_REQUEST['username']))
  8.     {
  9.  
  10.         $strLoginUsername = $_REQUEST['username'];
  11.         $strLoginPwd      = $_REQUEST['pwd'];
  12.    
  13.         include('connessione.php');
  14.  
  15.  
  16.         $strSQL   = "SELECT professori.codice from professori WHERE username = '$strLoginUsername' AND (pwd = '$strLoginPwd')";
  17.         $queryRis = pg_exec($connessione, $strSQL);
  18.         $iRows    = pg_num_rows($queryRis);
  19.  
  20.         // se iRows == 1 allora nella base di dati esiste il record di questo utente
  21.         if ($iRows == 1)
  22.         {
  23.             $vetRis = pg_Fetch_Array($queryRis, 0);
  24.  
  25.  
  26.             $_SESSION['utente'] = $strLoginUsername;
  27.  
  28.  
  29.             header('Location:PersonalArea.php');
  30.         }
  31.         else
  32.         {
  33.             $strMex = "Attenzione: Credenziali errate";
  34.         }
  35.        
  36.         pg_freeresult($queryRis);
  37.         pg_close($connessione);
  38.     }
  39.    
  40. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top