<?php
session_start();
require('connect.php');
if (isset($POST['name'])&& isset($POST['password'])) {
$name = $POST['name'];
$password = $POST['password'];
$query = "SELECT * FROM users WHERE name = '$name' and password = '$password'";
$result = mysqli_query($connection, $query) or die(mysqi_error($connection));
$count = mysqli_num_rows($result);
if ($count == 1) {
$_SESSSION['name'] = $name;
}else {
$fmsg = "error"; }
if (isset($_SESSSION['name'])) {
$username = $_SESSSION['name'];
}
}
?>