Thanks very mush for the detailed observations, appreciate the time taken by you. I have made some changes as suggested. Of the 14 suggestions ie 1,2,4,9,14 I have changed as enclosed:
<?php
session_start();
session_regenerate_id (true);
setlocale(LC_MONETARY, 'en_IN');
date_default_timezone_set('Asia/Kolkata');
include "config.php"
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title> FDMS Login : </title>
<link rel="stylesheet" href="/css/mobile.css" media= "screen and (max-width: 768px)" type="text/css" />
<link rel="stylesheet" href="/css/login.css" type="text/css"/>
</head>
<body>
<header>FDMS Staff Login</header>
<?php
if ($_POST['login']) {
$username=trim($_POST['username']);
$password=trim($_POST['password']);
$query = "SELECT * FROM staff WHERE staff_name='$username'";
$result = mysqli_query($conn, $query) ;
while ($row=mysqli_fetch_array($result)) {
$staff=$row['staff_name'];
$password_hash=$row['password'];
$userlevel=$row['level'];
if (password_verify($password,$password_hash )) {
$_SESSION['username'] = $username;
$_SESSION['user_level'] = $userlevel;
if ($userlevel==0) {
header("Location:attendence.php");
exit();
}
if ($userlevel==9) {
header("Location:complaint.php");
exit();
} else {
echo "invalid";
}
}
}
}
?>
<main>
<div class="form_login">
<form method="POST" name="login" id="login">
<div class="row">
<input type="text" name="username" placeholder="Username" autofocus="true"/>
</div>
<div class="row">
<input type="password" name="password" placeholder="Password"/>
</div>
<div class = "button">
<input type="submit" value="Login" name="submit_pass"/>
</div>
</form>
</div>
</main>
<div class='bottom'>
<a href='index.php'>Return to Website</a>
</div>
<footer>@ Deepak</footer>
</body>
</html>
the rest 4,5,6,7,8,11,12,13 I did not get
Thanks again