I need help - my hosting company does not give access to php.ini and I keep getting this error:
Warning:
Cannot modify header information - headers already sent by (output started at /home/virtual/site168/fst/var/www/html/index.php:5) in /home/virtual/site168/fst/var/www/html/index.php on line 96
I do have ob_start() function at the very beginning and at the end. Please help
code:
<? include "config.php"; ?><br>
<? ob_start (); ?>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<html>
<head>
<title><?=$appname;?> v<?=$appversion;?></title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<?=$cright;?>
<style>
body, table, form, textarea {text-align:left;font-family:Verdana, Arial, Helvetica; font-size: 10px;}
input {font-family:Verdana, Arial, Helvetica; font-size: 10px;}
a:link{text-decoration:none;}
a:visited{text-decoration:none;color:#666699;}
a:hover{color:red;}
a:active{color:orange;}
</style>
</head>
<body>
<table width="460" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td valign="top">
<center><strong>Please leave a note</strong><br />use the calendar below to navigate to a date</center><br />
<table border=1 cellpadding=0 cellspacing=0 bgcolor=silver>
<tbody><tr><td align="center" valign="top">
<script src="mycal.js" type="text/javascript" language="javascript"></script>
</td></tr></tbody>
</table>
<br /><center><a href="<?=$PHP_SELF;?>">Today <?=date("Y-m-d");?></a></center>
</td>
<td><img height=1 alt="" src="images/tiny.gif" width=8></td>
<td valign="top">
<table width=251 border=0 cellpadding=0 cellspacing=0 background="images/bgline.gif" bgcolor=#ffffff>
<tbody>
<tr>
<td colspan=5><table width="100%" height="80" border="0" cellpadding="0" cellspacing="0" background="images/top_bg.gif">
<tr>
<td height="45" align="left" valign="top"> </td>
<td align="center" valign="bottom"><img src="images/images/journal_top_01.gif" width="53" height="45"><img src="images/images/journal_top_02.gif" width="100" height="45"><img src="images/images/journal_top_03.gif" width="101" height="45"><img src="images/images/journal_top_04.gif" width="100" height="45"><img src="images/images/journal_top_05.gif" width="67" height="45"></td>
<td align="right" valign="top"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor=#b5b5b5><img height=1 alt="" src="images/tiny.gif" width=1></td>
<td colspan=3><img height=10 alt="" src="images/tiny.gif" width=1></td>
<td bgcolor=#b5b5b5><img height=1 alt="" src="images/tiny.gif" width=1></td>
</tr>
<tr>
<td bgcolor=#b5b5b5><img height=1 alt="" src="images/tiny.gif" width=1></td>
<td><img height=1 alt="" src="images/tiny.gif" width=10></td>
<form name="form1" id="form1" method="post" action="index.php">
<td><img height=8 alt="" src="images/tiny.gif" width=430><br />
<?
if ((!$day || !$year || $month) && !$mydate) {
$mydate = date("Y-m-d");
} else {
$month = $month+1;
if ($month && $year && $day) {
$mydate = "$year-$month-$day";
}
}
echo "<strong style='font-size: 13px;color:#666699;'>$mydate</strong><br /><br />";
echo "<input type=\"hidden\" name=\"mode\" value=\"gowrite\">";
echo "<input type=\"hidden\" name=\"mydate\" value=\"$mydate\">";
$sql = "select * from notes where notes_date='$mydate' order by notes_time asc";
$result = mysql_query($sql);
while ($row=mysql_fetch_array($result)) {
echo "
<strong style='font-size: 11px;'>$row[notes_user]</strong> [".substr("$row[notes_time]", -8)."]<br />".nl2br(stripslashes($row[notes_note]))."<br /><br />
";
}
mysql_free_result($result);
if ($mynotes && $user && $pass) {
if ($allowhtml == "0") {
$mynotes = str_replace("<", "<", "$mynotes");
$mynotes = str_replace(">", ">", "$mynotes");
}
if ($mydate && $todayonly == "0") {
$sql = "insert into notes (notes_date,notes_note,notes_time,notes_user) values ('$mydate','$mynotes',NOW(),'$user')";
} else {
$mydate = date("Y-m-d");
$sql = "insert into notes (notes_date,notes_note,notes_time,notes_user) values ('$mydate','$mynotes',NOW(),'$user')";
}
while (list ($key, $val) = each ($allowed)) {
if ($key == "$user" && $val == "$pass") {
mysql_query($sql) or die("error 324343");
}
}
$adate = explode("-", $mydate);
$mymonth = $adate[1]-1;
header("Refresh:0;url=$PHP_SELF?day=$adate[2]&month=$mymonth&year=$adate[0]");
}
if ($todayonly == "1") {
$posttext = "<strong style='font-size: 10px;color:#666699;'>Note: You can only post under today's date</strong>";
} else {
$posttext = "<strong style='font-size: 10px;color:#666699;'>Note: You can post notes under any date, past, present or future</strong>";
}
?>
<br />
<input name="user" type="text" value="" style="width:135; height:17"> :<strong style='font-size: 10px;color:#666699;'>Username</strong>
<input name="pass" type="password" value="" style="width:135; height:17"> :<strong style='font-size: 10px;color:#666699;'>Password</strong><br />
<textarea name="mynotes" style="width:430; height:80"></textarea><br />
<?=$posttext;?><br /><br />
<input name="submitField" type="submit" value=" post new note " style='font-size: 10px;background-color:#666699;color:#ffffff;height:23'>
</td>
</form>
<td><img height=1 alt="" src="images/tiny.gif" width=10></td>
<td bgcolor=#b5b5b5><img height=1 alt="" src="images/tiny.gif" width=1></td>
</tr>
<tr>
<td bgcolor=#b5b5b5><img height=1 alt="" src="images/tiny.gif" width=1></td>
<td colspan=3><img height=10 alt="" src="images/tiny.gif" width=1></td>
<td bgcolor=#b5b5b5><img height=1 alt="" src="images/tiny.gif" width=1></td>
</tr>
<tr>
<td bgcolor=#b5b5b5 colspan=5><img height=1 alt="" src="images/tiny.gif" width=251></td>
</tr>
</tbody>
</table>
<center>
<br />
</center>
</td></tr>
</table>
</body>
</html>
<? ob_end_flush (); ?>