When I run this page, it shows an error:
if (isset($_POST['send'])) {
mysql_connect("localhost", "MY_DB", "MY_PASSWORD") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
$username = $_POST['username'];
$password = $_POST['password'];
$result = mysql_query("SELECT * FROM manager WHERE username='$username'") or die(mysql_error());
$row = mysql_fetch_array($result);
if ($password == $row['password']) {
$_SESSION['confirm'] = '1';
header("Location: view.php");
} else {
echo"Not User";
}
}
It should echo the data of a MySQL table. It logs in correctly, but it does not redirect to view.php. The error is:
Warning: Cannot modify header information - headers already sent by (output started at /home/mftporta/public_html/tooga/login.php:5) in /home/mftporta/public_html/tooga/login.php on line 21