0

I am having bit of a problem with session_start(). I know that session_start() needs to be at the top of the page. And I am doing so but still having problem. May be I am missing something. Here is what I am doing ---

init.php file :

<?php
session_start();
error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once("Database.php");
require_once("functions.php");
require_once("admin_operations.php");
require_once("general.php");
require_once("Session.php");

And I am another file call doctype.php where I am doing the followings---

<?php 
    require_once('config/init.php');
    $sessions = new Session();
    $sessions -> redirect();
?>

<!doctype html>
<html class="no-js" lang="">
    <head>
  </head>
<body>

</body>
</html>

Now I am still getting the errors. I don't know what I am doing wrong here. Can anyone please help me? Thanks a lot.

jahid
  • 139
  • 2
  • 11
  • `error_reporting(E_ALL);` has to be at the top of the page – pavlovich Dec 05 '15 at 13:13
  • Ok. Let me try. thanks mate. – jahid Dec 05 '15 at 13:16
  • Nop. Doesn't work mate. – jahid Dec 05 '15 at 13:17
  • 1
    `error_reporting(E_ALL);` would only enable reporting of error, not fix this issue. Would like some more information though. I'm guessing the headers were already sent (and you didn't include this in your question)? Encoding of the file can sometimes mess up headers, Take a look at [Headers already sent](http://stackoverflow.com/q/8028957/4535200). – Qirel Dec 05 '15 at 14:09

0 Answers0