Hi (again),
I am getting the following error:
Warning: Cannot add header information - headers already sent by (output started at C:\Intranet\php\login\session\session.class.php:39) in C:\Intranet\php\login\doLogin.class.php on line 74
/ Performs the required login, sets the session variables and updates the users last login time /
function _doLogin( $username, $privilege, $firstname )
{
/ Set the session variables username, privilege, firstname and set logged to now be true /
$this->_session->setSession( $username, $privilege, $firstname, 'true' );
/ Update the last Login /
$this->_updateLastLogin( $username );
/ Clean the output buffer /
ob_clean();
/ Redirect to the home page /
header( "location: ../content/home.class.php" ); //LINE 74
}
<?php
session_start();
class Session
{
function Session()
{
$this->_registerSession();
}
/** Register the session variables **/
function _registerSession()
{
/** Create the new session variables **/
session_register( 'username' );
session_register( 'privilege' );
session_register( 'firstname' );
session_register( 'logged' );
/** Register the default values **/
$_SESSION['username'] = NULL;
$_SESSION['privilege'] = NULL;
$_SESSION['firstname'] = NULL;
$_SESSION['logged'] = false;
}
/** Sets the session with $username, $privilege, $firstname and $logged **/
function setSession( $username, $privilege, $firstname, $logged )
{
$_SESSION['username'] = $username;
$_SESSION['privilege'] = $privilege;
$_SESSION['firstname'] = $firstname;
$_SESSION['logged'] = $logged;
}
}//End Session
?> //LINE 39 HERE