<?php
session_start();
if(isset($_POST['login']) && isset($_POST['password'])){
$login = htmlspecialchars(trim($_POST['login']));
$password = htmlspecialchars(trim($_POST['password']));
include 'db-config.php';
$user_check = mysql_query("SELECT * FROM users WHERE login='$login'");
$user_info = mysql_fetch_array($user_check);
if($login == $user_info['login'] && $password == $user_info['password']){
$_SESSION['login'] = $user_info['login'];
$_SESSION['id'] = $user_info['id'];
echo '<script type="text/javascript">location.replace("https://yappi.ml/feed");</script>';
} else {
echo 'Введите коректные данные';
}
}
?>