Warning: Cannot modify header information - headers already sent by 
<p>my code-</p>

<pre><code>&lt;?php

$username = $_POST['username'];
$password = $_POST['password'];

require 'database.php';

$q = "SELECT id FROM users WHERE user_name = '$username' AND password = '$password'";

$result = $mysqli-&gt;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");  
}

?&gt;
</code></pre>

<p><strong>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</strong></p>

<p><code>there is no white space and BOM is also ASCI</code></p>
