Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $_SESSION["utente"]=$_POST["utente"];
- $_SESSION["password"]=$_POST["password"];
- $server = "localhost";
- $username = "s01116";
- $password = "quee2Lie";
- $database = "5bi_s01116";
- $connect = mysqli_connect($server, $username, $password)
- or die("Connessione non riuscita: " . mysqli_error($connect));
- mysqli_select_db($connect, $database)
- or die ("Impossibile selezionare il db");
- $critt = md5($_POST['password']);
- $query = "SELECT utente,parola_chiave FROM myutenti WHERE utente='".$_POST['utente']."' AND parola_chiave ='". $critt ."'"
- or die ("Errore nella query" . mysqli_error($connect));
- $result = mysqli_query($connect, $query)
- or die ("Errore nella query" . mysqli_error($connect));
- $g=mysqli_num_rows($result);
- if($g>0)
- {
- header('location:'."sceltaquery.php");
- exit;
- }
- else
- {
- print("Credenziali di accesso errate!");
- }
- mysqli_close($connect);
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>LOGIN</title>
- <link rel = "stylesheet" text = "type/css" href = "login2.css">
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement