my code-
<?php
$username = $_POST['username'];
$password = $_POST['password'];
require 'database.php';
$q = "SELECT id FROM users WHERE user_name = '$username' AND password = '$password'";
$result = $mysqli->query($q) or die(mysqli_error());
if (mysqli_num_rows($result) == 1) {
setcookie('authorized', 1, 0);
header("Location: index.php");
} else {
header("Location: login.php");
}
?>
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\pics\database.php:1) in C:\xampp\htdocs\pics\confirm_login_credentials.php on line 13
there is no white space and BOM is also ASCI