Jump to content

[SOLVED] Sessions, headers, and warnings, oh my!


levi2613

Recommended Posts

I've been banging my head against the wall for a few hours now, and I'm sure I'm overlooking something dumb....

 

I have a shift report form that has a .inc include at the top to redirect to a report_view if it has already been submitted:

 

<?include 'schedule/admin/shift_report.inc';?>
<?include 'employee/index/session.inc';?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<head>
   <link rel="stylesheet" href="/new/style.css" type="text/css" charset="utf-8">
   <link rel="stylesheet" href="/new/print.css" type="text/css" media="print">
   <script type="text/javascript" src="/new/employee/index/session.js"></script>
   <title>Shift Report</title>
</head>

 

The code for the .inc file:

 

...
if (mysql_num_rows($report_query)) {
      $report = mysql_fetch_assoc($report_query);
  
      if ($report['submitted']) {
         header("Location:schedule/admin/shift_report_view.php?date=$date");
         exit;
      }
   }

 

The report_view page has a similar setup:

 

<?include 'schedule/admin/shift_report_view.inc';?>
<?include 'employee/index/session.inc';?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<head>
 <link rel="stylesheet" href="/new/style.css" type="text/css" charset="utf-8">
 <link rel="stylesheet" href="/new/print.css" type="text/css" media="print">
 <script type="text/javascript" src="/new/employee/index/session.js"></script>
   <title>Shift Report</title>
</head>

 

The session files log the user off after 30 minutes of inactivity.  These files work on all my other pages, but just in case, I removed every instance of them in these files, and I still get the error....  I don't see any "echo"s or "print"s, but I'm still getting the ubiquitous:

 

Warning: Cannot modify header information - headers already sent by (output started at /.../employee/index/session.inc:31) in /.../employee/schedule/admin/shift_report.inc on line 45

 

The session.inc file is only 30 lines long, and line 45 in shift_report.inc is the header call.

 

*Any* help is much, much appreciated.

 

Thanks,

Levi

I tried pulling all the .inc code into the top of the files (including all the session.inc stuff), but still no joy.  I'm working in PSPad, so I've never had any newline issues.  The warning keeps citing the script include in the <head> section, but when I pull it out, I still get the same thing.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.