This is probably a duplicate but i am having this issue on login when running the following code
<?php
include('includes/functions.php');
if(isset($_POST['login'])) {
if(isset($_POST['username'])) {
if(isset($_POST['password'])) {
$username = $_POST['username'];
$query = mysql_query("SELECT * FROM users WHERE Username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
if(md5($_POST['password']) == $user['password']); {
echo 'Login successful';
$_SESSION['user'] = $user['FullName'];
header("Location:index.php");
}
} else {
echo "Please check your password!";
include('login.php');
}
} else {
echo "Please check your Username!";
include('login.php');
}
} else {
echo "Please check you filled out the login form!";
include('login.php');
}
?>
So when username and password are entered i get this output in browser
Login successful
Warning: Cannot modify header information - headers already sent by (output started at /home/site/public_html/admin/dologin.php:12) in /home/site/public_html/admin/dologin.php on line 14
All help will be greatly appreciated