Ok this is the code! I'm developing on phpstorm the problem is that everytime I hit submit the page refreshes but doesnt redirect or execute the echo with the variables!
Can someone please point any mistakes?
require_once "db.php";
$html = <<<TAG
<!DOCTYPE html>
<html>
<head>
<title>Log In</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<style>
html, body, .container {
    height: 100%;
}
.container {
    display: table;
    vertical-align: middle;
}
.vertical-center-row {
    display: table-cell;
    vertical-align: middle;
}
</style>
</head>
<body>
<div class="container">
    <div class="row vertical-center-row">
        <div class="col-lg-12">
            <div class="row">
                <div class="col-xs-4 col-xs-offset-4">
                <h3>Sign In</h3>
                <br>
                    <form action="login.php" method="post" role="form">
                    <div class="form-group">
                    <label for="name"> Name: </label>
                    <input class="form-control" name="name" value="Username" type="text" id="name">
                    </div>
                    <div class="form-group">
                    <label for="password"> Password:</label>
                    <input class="form-control" name="password" value="Password" type="password" id="password">
                    </div>
                    <button type="submit" class="btn btn-primary">Submit</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
TAG;
echo $html;
if(isset($_POST['submit'])){
    $escapedName = mysqli_real_escape_string($_POST['name']);
    $escapedPW = mysqli_real_escape_string($_POST['password']);
    $testPW = hash('sha1', $escapedPW);
    echo $escapedName . $escapedPW;
    $sql = "select * from users where name ='$escapedName' and password='$testPW'";
    if($conn->query($sql)){
        header('location: /user.php');
    }
}
else{
    echo "se di ca ka";
}
 
    