Warning: Supplied argument is not a valid MySQL result resource in /www/cgi/account/include/database.php on line 459
Warning: Cannot send session cache limiter - headers already sent (output started at /www/cgi/account/include/database.php:459) in /www/cgi/account/include/session.php on line 50
Warning: Supplied argument is not a valid MySQL result resource in /www/cgi/account/include/database.php on line 459
Warning: Supplied argument is not a valid MySQL result resource in /www/cgi/account/include/database.php on line 459
database.php lines 451-460
[code ]/**
* calcNumActiveGuests - Finds out how many active guests
* are viewing site and sets class variable accordingly.
*/
function calcNumActiveGuests(){
/* Calculate number of guests at site */
$q2 = "SELECT * FROM ".TBL_ACTIVE_GUESTS;
$result2 = mysql_query($q2, $this->connection);
$this->num_active_guests = mysql_num_rows($result2); /*line 459*/
}[/code]
session.php lines 48 - 81
Warning: Cannot send session cache limiter - headers already sent (output started at /www/cgi/account/include/database.php:459) in /www/cgi/account/include/session.php on line 50
Warning: Supplied argument is not a valid MySQL result resource in /www/cgi/account/include/database.php on line 459
Warning: Supplied argument is not a valid MySQL result resource in /www/cgi/account/include/database.php on line 459
database.php lines 451-460
[code ]/**
* calcNumActiveGuests - Finds out how many active guests
* are viewing site and sets class variable accordingly.
*/
function calcNumActiveGuests(){
/* Calculate number of guests at site */
$q2 = "SELECT * FROM ".TBL_ACTIVE_GUESTS;
$result2 = mysql_query($q2, $this->connection);
$this->num_active_guests = mysql_num_rows($result2); /*line 459*/
}[/code]
session.php lines 48 - 81
- Code:
function startSession(){
global $database; //The database connection
session_start(); //Tell PHP to start the session line 50
// Determine if user is logged in
$this->logged_in = $this->checkLogin();
//
// Set guest value to users not logged in, and update
// active guests table accordingly.
if(!$this->logged_in){
$this->username = $_SESSION['username'] = GUEST_NAME;
$this->userlevel = GUEST_LEVEL;
$database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time);
} else {// Update users last active timestamp
$database->addActiveUser($this->username, $this->time);
}
// Remove inactive visitors from database
$database->removeInactiveUsers();
$database->removeInactiveGuests();
// Set referrer page
if(isset($_SESSION['url'])){
$this->referrer = $_SESSION['url'];
} else {
$this->referrer = "/";
}
// Set current url
$this->url = $_SESSION['url'] = $_SERVER['PHP_SELF'];
}