Hi guys could someone please check my code and see whats wrong, i just cant see the error myself.
<?php
ini_set('display_error', 1);
error_reporting(E_ALL | E_STRICT);
session_start();
$username =$_POST['username'];
$password = $_POST['password'];
require('../include/db_include.php');
$query = "SELECT id,
username,
password,
is_admin
FROM cvk_runners WHERE username = '$username'";
$Result = $objConnection->query($query);
$row = $Result->fetch_assoc();
$_SESSION['id'] = $row['id'];
if($username == $row['username'] && $password == $row['password'] && $row['is_admin'] == 0){
$_SESSION['auth']=0;
header("location:../pages/admin.php");
}
elseif($username == $row['username'] && $password == $row['password'] && $row['is_admin'] == 1){
$_SESSION['auth']=1;
header("location:../index.php");
} else {
$_SESSION['loginmessage'] = 'forkert login info';
header ('location:../index.php');
}
?>