<?php
session_start();
include 'dbc.php';


$username=$_POST["username"];
$user_pass=$_POST["hf-password"];

$sql="Select * from users where username='$username' and userpwd='$user_pass'";
$result = $conn->query($sql);
//$rows=mysql_num_rows($result);
//$user_data=$result->fetch_assoc();
//echo $result->num_rows;
  if($result->num_rows==0)
  
    {
	   echo "Wrong Id or Password";
	  }
	  else
	  {
	  while($row = $result->fetch_assoc()) {
        $_SESSION["userid"]=$row["userid"];
	  $_SESSION["username"]=$row["username"];
	  
	  
	 
	  header("location:maindashboard.php");
	
	 }
    }
	  
	 
?>
<a href="index.html"> Back </a>