<?php
include('security.php');
if (isset($_POST['login_btn'])) {
$email_login = $_POST['email'];
$password_login = $_POST['password'];
$query = "SELECT * FROM register WHERE email='$email_login' AND password='$password_login' ";
$query_run = mysqli_query($connection, $query);
$usertypes = mysqli_fetch_array($query_run);
if ($usertypes['usertype'] == "admin") {
$_SESSION['username'] = $email_login;
header('Location:/index.php');
} else if($usertypes['usertype'] == "user"){
$_SESSION['username'] = $email_login;
header('Location:../index.php');
}else{
$_SESSION['status'] = "Email or Password is invalid";
header('Location:login.php');
}
}
?>
Warning: Cannot modify header information - headers already sent by (output started at /home/imvvsmcb/public_html/admin/database/dbconfig.php:1) in /home/imvvsmcb/public_html/admin/logincode.php on line 14