if (isset($_POST['login_u'])) {
$login_true = mysqli_query($connections, "
SELECT * FROM `users` WHERE login='".$_POST['login']."' AND password = MD5('".$_POST['password']."');
");
if ($login_true) {
$count = mysqli_num_rows($login_true);
if ($count > 0) {
$_SESSION['login_user'] = $login_true;
}else{
echo "Не правильно";
}
}
$_SESSION['user_name'] = $_POST['login'];
}
<?php echo $_SESSION['user_name']; ?>
<form action="" method="POST">
<p class="text-center">Форма входа</p>
<input type="text" name="login" class="form-control" placeholder="Введите логин"><br/>
<input type="password" name="password" class="form-control" placeholder="Введите пароль"><br>
<button type="submit" name="login_u" class="btn btn-success">Войти</button>
</form>