I've been searching everywhere and trying everything so far to no avail.
This is the error message I'm getting while logging in:
Warning: Cannot modify header information - headers already sent by (output started at /home/param/public_html/edit/includes/header.php:8) in /home/param/public_html/edit/includes/functions.php on line 33.
I can hit refresh on the browser and then resent and everything works fine from that point on. Also the code works flawlessly on my local drive.
This is the code area in question for header.php, there actually is no php here so I don't understand why the warning is pointing here.
Code: Select all
6. <link href="styles/public.css" media="all" rel="stylesheet" type="text/css" />
7. </head>
8. <body bgcolor="#cfcfcf">
9. <table width="1000" border="0" cellspacing="0" cellpadding="0" align="center">
Code: Select all
31. function redirect_to( $location = NULL ) {
32. if ($location != NULL) {
33. header("Location: {$location}");
34. exit();
35. }
36. }
Code: Select all
<?php require_once("includes/functions.php"); ?>
<?php
session_start();
function logged_in() {
return isset($_SESSION['user_id']);
}
function confirm_logged_in() {
if (!logged_in()) {
redirect_to("login.php");
}
}
?>
Made sure the session call is the first thing on the pages.
Made sure there is no white space before the session calls.
Copied the code from Dreamweaver, pasted it into Notepad and save as ANSI.
Pulled out a lot of hair.