Advertisement
Guest User

Untitled

a guest
Mar 10th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $_SESSION["utente"]=$_POST["utente"];
  4. $_SESSION["password"]=$_POST["password"];
  5.  
  6. $server = "localhost";
  7. $username = "s01116";
  8. $password = "quee2Lie";
  9. $database = "5bi_s01116";
  10.  
  11. $connect = mysqli_connect($server, $username, $password)
  12. or die("Connessione non riuscita: " . mysqli_error($connect));
  13.  
  14. mysqli_select_db($connect, $database)
  15. or die ("Impossibile selezionare il db");
  16.  
  17. $critt = md5($_POST['password']);
  18.  
  19. $query = "SELECT utente,parola_chiave FROM myutenti WHERE utente='".$_POST['utente']."' AND parola_chiave ='". $critt ."'"
  20. or die ("Errore nella query" . mysqli_error($connect));
  21. $result = mysqli_query($connect, $query)
  22. or die ("Errore nella query" . mysqli_error($connect));
  23.  
  24. $g=mysqli_num_rows($result);
  25.  
  26. if($g>0)
  27. {
  28. header('location:'."sceltaquery.php");
  29. exit;
  30. }
  31. else
  32. {
  33. print("Credenziali di accesso errate!");
  34. }
  35. mysqli_close($connect);
  36. ?>
  37. <!DOCTYPE html>
  38. <html>
  39. <head>
  40. <title>LOGIN</title>
  41. <link rel = "stylesheet" text = "type/css" href = "login2.css">
  42. </head>
  43. <body>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement