having a problem with my scripts,
ive tried looking for whitespaces at the end of my tags and everything else that is posted in these forums:
the error:
Warning: Cannot add header information - headers already sent by (output started at /home3/sy89/public_html/publicnav.inc:12) in /home3/sy89/public_html/clib.inc on line 21
contents of publicnav.inc:
<?php
if ($session[logged_in])
{
?>
<p><a href="welcome.html?<?php print SID ?>">Home</a>|
<a href="logout.php?<?php print SID ?>">Logout</a></p>
<hr>
<?php
}
else
{
echo "You Are Not Logged in";
}
?>
contents of clib.inc:
<?php
session_register("sessiontest");
session_start();
function cleanMemberSession( $id, $login, $pass )
{
global $session;
$session[id] = $id;
$session[login] = $login;
$session[password] = $pass;
$session[logged_in] = true;
}
function checkuser()
{
global $session, $logged_in;
$session[logged_in] = "0";
$c_row = getrow("users", "id", $session[id]);
if (! $c_row ||
$c_row[login] != $session[login] ||
$c_row[password] != $session[password])
{
header("Location: login.php.SID");
exit;
}
$session[logged_in] = "1";
return $c_row;
}
?>
contents of page trying to load (the error page):
<?php
include("clib.inc");
include("dblib.inc");
include ("publicnav.inc");
include("nav.inc");
?>
<head>
<title>Student Area</title>
</head>
<body>
<?php
$c_row = checkuser();
$message = " ";
if ( $session[logged_in] )
{
?>
<! -- Content goes here! --!>
Test!
<?php
}
else
{
echo "You are not logged in";
}
?>
</body>
can anybody help????
cheers