Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/board.php:1) in /var/www/sessions.php on line 116
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/board.php:1) in /var/www/sessions.php on line 116
Fatal error: Call to a member function on a non-object in /var/www/sessions.php on line 57
Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0
//function to destroy our session
function session_end( $sessid )
{
global $DBI;
$query_string = "DELETE FROM diet_sessions WHERE sessionID = '$sessid
$query = $DBI->query( $query_string );
return $query;
}
function session_gc( $maxlifetime )
{
global $DBI;
$query_string = "DELETE FROM diet_sessions WHERE expires < ".time();
$query = $DBI->query( $query_string );
return 1;
}
//setup PHP's session handler to use our functions instead of the defau
session_set_save_handler( "session_open",
"session_close",
"session_read",
"session_write",
"session_end",
"session_gc");
//finally, startup our session
session_start();
?>
my $DBI is a class which is in called in the include.php file.
The $DBI class works, iam certain, but i dont know why the sessions file gives out, and why cant I send out the session_start();
I know its supposed to be at the stop of every script, but in this case as iam writing my owne session functions, it shouldnt matter??
You've got some string termination issues on your query strings. You're including code in your query strings because they are not terminated properly with closing quotes.
is it the way I call the database script that has the DBI class ?
I do $DBI = new DBI( "mysql://root***@localhost/db" );
at the end of the database script. and then include that in the sessions.php
It's very likely that this is the root of your problem. Not knowing what parameters your class constructor is expecting makes it impossible for me to say for sure. I will say it looks very strange tho.