I am also getting this error. I've looked around for a while and haven't figured out how to fix it, but my errors are for all of my PHP code. This is kind of weird. So here is my code.
<?php session_start();?><html><?php
if(isset($_SESSION['loggedinuser']))
echo "You're logged in! Click <a href='profile.php'>Here</a> to view your profile";
else {
echo "You're not logged in. Do you want to <a href='login.php'>log in</a> or <a href='register.html'>register</a>?";
}
?>
<head>
<title>UrComics.com Your comics, Your votes!</title>
<link rel="stylesheet" type="text/css"
href="style.css" />
</head>
<body>
<table border="1" cellspacing="0" cellpadding="1" align="left">
<tbody>
<tr>
<td>
<img alt="" src="./Images/UrComicsLogo1.gif" />
<br />
<h5 align="center">
<a href="index.php">Home</a>
<br />
<a href="UrPaper.php">Ur Paper</a>
<br />
<a href="inThePaper.php">In The Paper</a>
<br />
<a href="Help.html">Help/FAQ</a>
<br />
<a href="uploadcomic.php">Submit A Comic</a>
</h5>
</td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="2" cellpadding="2" align="center" width="75%">
<tbody>
<tr>
<td>
<h1 align="center">Welcome to UrComics.com</h1>
</td>
<td>
<h3>Hits</h3>
<hr align="left" width="100%" "noshade" size="2" />
<h3>
<?php
$filename = "counter.txt" ;
$fd = fopen ($filename , "r") or die ("Can't open $filename") ;
$fstring = fread ($fd , filesize ($filename)) ;
echo "$fstring" ;
fclose ($fd) ;
$fd = fopen ($filename , "w") or die ("Can't open $filename") ;
$fcounted = $fstring + 1 ;
$fout = fwrite ($fd , $fcounted) ;
fclose ($fd) ;
?>
</h3>
<br />
</td>
</tr>
<tr>
<td width="50%" class="red">
<h3 align="center">Announcements</h3>
<hr align="left" width="100%" "noshade" class="red" size="2" />
<br />
<p>Welcome to urcomics.com where you can post your own comics and see what others think of your idea.
Just create an account to get started!</p>
<a href="register.html">Click Here to Get Started!</a>
</td>
<td width="50%" class="blue">
<h3 align="center">Comics Of The Week</h3>
<hr align="left" width="100%" "noshade" class="blue" size="2" />
<br />
<p>Once I figure out the php i am gonna put the top rated comics of the week on here.</p>
</td>
</tr>
<tr>
<td class="green" align="left">
<h3 align="center">Login</h3>
<hr align="left" width="100%" "noshade" class="green" size="2" />
<br />
<?php
if(isset($_SESSION['loggedinuser'])) {
?>
You're currently logged in, do you want to <a href="logout.php">Log out</a>?
<?php
} else {
?>
<p>Put in your username and password to login.</p>
<br />
<form name="authenticate" method="post" action="authenticate.php">
Username:<input name="username" type="text" size="20">
<br />
Password:<input name="password" type="password" size="20" />
<br />
<input type="submit" name="submit" value="submit"/>
<input type="reset" name="clear" value="reset"/>
</form>
<?php
}
?>
</td>
</tr>
</tbody>
</table>
</body>
</html>
So I am getting these errors at the top of my page.
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\file\secret\index.php:1) in C:\anotherfile\file\index.php on line 1
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\files\morefiles\index.php:1) in C:\morefiles\stuff\index.php on line 1
NOTE:That is not really the file location.
But it is weird because the code was working then it just stopped working. and none of my php works so I don't know if this is a problem in my php.ini file or what. Anyone know how to fix this?