Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $servername = "localhost";
- $username = "root";
- $password = "";
- $database="rivistaculinaria";
- // Create connection
- $conn = new mysqli($servername, $username, $password,$database);
- // Check connection
- if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
- else {};
- //LOGIN
- $user=$_POST['user'];
- $pass=$_POST['pass'];
- $sql="SELECT * FROM 'utente'WHERE Matricola=$user AND Password=$pass";
- $ris=mysqli_query($conn,$sql);
- $count=mysqli_num_rows($ris);
- if($count==1)
- {
- $_SESSION['user']=$user;
- echo "Login effettuato con successo";
- }
- else
- {
- echo "Nome utente o password errati";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement