zcollvee wrote:My website
I just added a user system. And this is the code I put into the menu.php and after that I included it into all the other files via include();
Why am I getting this error?
<table bgcolor="white" width="800" height="10" border='0'>
<tr>
<td>
<p align="right">
<?php
session_start();
Typically, you should avoid to put session_start() in files that are included/required.
Say you have an index.php, where you include a script that checks session
to see if user is logged in.
I would put [man]session_start[/man] at the beginning of index.php
It is important to START Session early,
before any possible E_NOTICE or other ECHO output to screen.
This has been told a 1.000 of times in this place.
And this issue is surely cover in some STICKY FAQ in our forum.
index.php
<?php
// to avoid Errors, Notices like: headers already sent
// we start session here, before check $_SESSION['user']
// in the reuired include 'user_check.php'
session_start();
require('user_check.php');
include( 'header.php');
include( 'menu.php');
include( 'contents.php');
include( 'footer.php');
//more code
//and more and more ...
exit(); // properly end php
?>
regars 🙂
halojoy