Can anyone help figure out why this doesnt work? I'm using the output buffer but I still get the error saying header information already sent out.
Login.php:
<?
ob_start();
$settings[cookiedomain] = ".htmlfunction.beigetower.org/";
$settings[cookiepath] = "/";
include("connect.php");
$user = $_POST['username'];
$pass = $_POST['password'];
$password = md5($pass);
$mysqli = mysql_query("SELECT * FROM `dtusers` WHERE `user` = '$user' AND `password` = '$password'");
$mysqli_n_r = mysql_num_rows($mysqli);
if ($mysqli_n_r == "0") {
print "Sorry that is an invalid username or password, please try again!";
} else if (isset($_COOKIE['id'])) {
print "Youre already logged on!";
} else {
$mdname = md5($user);
setcookie("id", "$mdname", time() + time() * 3600 * 10, "/", "htmlfunction.beigetower.org", 1);
print "You have succesfully logged on!";
}
ob_end_flush();
?>
index.php:
<HTML>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- ImageReady Slices (template.psd) -->
<div align="center">
<br><br><br>
<TABLE WIDTH=650 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD COLSPAN=7>
<IMG SRC="images/template_01.gif" WIDTH=650 HEIGHT=133 ALT=""></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/template_02.gif" WIDTH=109 HEIGHT=21 ALT=""></TD>
<TD>
<IMG SRC="images/template_03.gif" WIDTH=67 HEIGHT=21 ALT=""></TD>
<TD>
<IMG SRC="images/template_04.gif" WIDTH=108 HEIGHT=21 ALT=""></TD>
<TD>
<IMG SRC="images/template_05.gif" WIDTH=95 HEIGHT=21 ALT=""></TD>
<TD>
<IMG SRC="images/template_06.gif" WIDTH=85 HEIGHT=21 ALT=""></TD>
<TD>
<IMG SRC="images/template_07.gif" WIDTH=76 HEIGHT=21 ALT=""></TD>
<TD>
<IMG SRC="images/template_08.gif" WIDTH=110 HEIGHT=21 ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=7>
<IMG SRC="images/template_09.gif" WIDTH=650 HEIGHT=55 ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=7 background="/images/template_10.gif">
<?
$id = $_GET['page'];
if ($id == "home") {
print"<div align='center'><iframe source='JFrames.htm' width='500' height='460' scrollable='auto' name='content' border='0'></iframe></div>";
} else {
include ($id .".php");
}
?>
</TD>
</TR>
<TR>
<TD COLSPAN=7>
<IMG SRC="images/template_11.gif" WIDTH=650 HEIGHT=25 ALT=""></TD>
</TR>
</TABLE>
<!-- End ImageReady Slices -->
</div>
</BODY>
</HTML>
ERROR:
Warning: Cannot modify header information - headers already sent by (output started at /var/bt/home/web/dennmat/htmlfunction.beigetower.org/html/index.php:15) in /var/bt/home/web/dennmat/htmlfunction.beigetower.org/html/login.php on line 17
any help is greatly appreciated!