WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Optimized Online users class
Categories : PHP, PHP Classes, Sessions Click here to Update Your Picture
Ben Yacoub Hatem
Date : Jul 30th 2004
Grade : 4 of 5 (graded 3 times)
Viewed : 6683
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ben Yacoub Hatem
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

This class return online users in a website that using sessions. To give more acceptable information, sessions have been counted in an interval of 1 hour.

online class : Class that return users online optimised for an interval of one (1) hour.
@package
@author Ben Yacoub Hatem <hatem@php.net>
@copyright Copyright (c) 2004
@version $Id$ - 25/05/2004 14:04:22 - sessions.class.php
@access public
<?php
class online{
   
/**
     * Constructor
     * @access protected
     */
   
function online(){
       
    }
   
   
/**
     *
     * @access public
     * @return void
     **/
   
function who(){
       
$path = session_save_path();
        if (
trim($path)=="") {
            return
FALSE;
        }
       
$d = dir( $path); $i = 0;
        while (
false !== ($entry = $d->read())) {
               
            if (
$entry!="." and $entry!="..") {
               
$SESS[] = $entry;
                if (
filemtime($path."/$entry") < strtotime('-0 days 1 hours')) {
                   
$content[] = implode('',file($path."/$entry"));
                   
$i++;
                }
            }
        }
       
$d->close();
       
$result = "<span class=tab-s>$i Online users</span><br>\n";
        return
$result;
    }
   
}


$o = new online;
echo
$o->who();

?>



base64 with encryption - encode and decode sessions
Categories : PHP, PHP Classes, Encryption, Sessions
SPL and ITERATOR : examples
Categories : PHP, Object Oriented, PHP Classes, Sessions
A beginner's session handling class
Categories : PHP, PHP Classes, Sessions, Beginner Guides
Encrypted Sessions
Categories : PHP, PHP Classes, Sessions
Search and Replace Text : Searches Files for Specified Text and Replaces It by a Given Text
Categories : PHP, PHP Classes, Search, Filesystem
A damaged image generator (class) for validating text. CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart
Categories : PHP, PHP Classes, Security, GD image library, Security
Timer - a class that uses microtime() to provide easy calculation of elapsed times
Categories : Algorithms, PHP, PHP Classes
Class to convert any document, that can be read by MS Word, to another format supported by Word.
Categories : PHP Classes, PHP, Windows 2000, Microsoft Word, WinNT
Mssql database Manager
Categories : PHP, Databases, MS SQL Server, Classes and Objects, PHP Classes
SubmitForce URL power submitter (searchengine submission class)
Categories : PHP, Search Engines, URLs, PHP Classes
Blueshoes PHP Application Framework
Categories : PHP, Frameworks, PHP Classes
PHP Image Class
Categories : PHP, PHP Classes, Multimedia, GD image library
Gonx Proxy - This class is meant to act as an HTTP proxy to serve pages of a remote server as if they were local pages.
Categories : PHP, PHP Classes, HTTP
Open and Close your website in fixed times .
Categories : PHP, PHP Classes, Cron, Date Time
A login page that require username, password and userlevel.
Categories : PHP, Security, Sessions, MySQL, Databases