<?php
include "connect.php";

$username = $_POST['username'];
$password = $_POST['password'];


$select = $pdo->prepare("select * from user where username = '$username' and password = '$password'");
$select->execute();
$user_info = $select->fetch(PDO::FETCH_ASSOC);

if($select->rowCount() == 0) echo "not-found";
else {
    session_start();
    $_SESSION['user_logged'] = $user_info['id'];
    echo "found";
}
