line 40 is the end of a function:
function chksecurity($minlevel) // Check current user for acceptable security level
{
session_start();
global $user_id, $user_name , $access_level, $admin_statustbl, $REMOTE_ADDR, $HTTP_HOST, $REQUEST_URI;
// Record user activity into status table
$query = "insert into $admin_statustbl
user_id = '$user_id',
ip = '$REMOTE_ADDR',
url = '$HTTP_HOST$REQUEST_URI',
date = now()";
$result = mysql_query($query) or die(mysql_error());
if (!session_is_registered("user_id"))
{
include_once("../templates/template-inc.php");
$t = new Template("../templates");
$t->set_file('template','sec-login.ihtml');
$t->set_var('siteName',$siteName);
$t->set_var('pageTitle',$pageTitle);
$t->set_var('AdminPanelVer',$AdminPanelVer);
$t->set_var('error','<p class="mainBodyTitles"><font color="#FF0000">You need to be logged in to access this feature.</font></p>');
$t->pparse('Output', 'template');
exit;
}
}
This has session_start() in it, so why isnt it working?