0

EDIT: I was able to find my answer and fix the issue. However, it has brought me to a new question.

EDIT 2: I was able to also fix this issue also. I will post solution after 5 hours when it allows me to. Thanks again.

I keep getting the following Error/s:

Warning: session_start() [function.session-start]: Cannot send session cache limiter ... on line 18

Warning: Cannot modify header information - headers already sent by ... on line 145

Code can be found here

<?php $page = 'home'; ?>

<?php

define('INCLUDE_CHECK',true);

require 'connect.php';
require 'functions.php';
// Those two files can be included only if INCLUDE_CHECK is defined


session_name('tzLogin');
// Starting the session

session_set_cookie_params(2*7*24*60*60);
// Making the cookie live for 2 weeks

session_start();    <------LINE 18

if($_SESSION['id'] && !isset($_COOKIE['tzRemember']) && !$_SESSION['rememberMe'])
{

And there is more code all of which is before the opening bracket. I have shown line 18 above.

Lines 140 - 147

if(count($err))
{
$_SESSION['msg']['reg-err'] = implode('<br />',$err);
}   
header("Location: index.php");      <------ LINE 145
exit;
}

I have searched the forums here and have seen many answers on this question none of which apply to this specifically. I also know using '@' will only hide the error not resolve it.

Again thanks in advance.

Community
  • 1
  • 1
user2106354
  • 27
  • 2
  • 7
  • 1
    You should understand sessions and cookies first ,then coding a basic login system should be easy. Or use a cms or a framework instead of coding some raw php that will be insecure. – mpm Feb 25 '13 at 07:23
  • This panel is simply a way of getting me involved and coding with php. It will never be live. It's my way of learning so that I may implement it fully on my main site once I have it down. – user2106354 Feb 25 '13 at 07:53
  • ANSWER, Yet again, to my own question. I will post answer in 5 hours when it allows me. – user2106354 Feb 25 '13 at 09:57
  • You cannot modify the header once the page already starts outputting content, so prior to line 18, one of your includes is already modifying the header or outputting content to the page. – Husman Feb 25 '13 at 10:01

0 Answers0