Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

php help i'm stuck!

Name: help! 2010-06-17 23:21

<?php


/* Start the session */
session_start();

/* Defines how long the maximum amount of time the session can be inactive. */
define("MAX_IDLE_TIME", 3);

function getOnlineUsers(){

    if ( $directory_handle = opendir( session_save_path() ) ) {
    $count = 0;
       
        while ( false !== ( $file = readdir( $directory_handle ) ) ) {
           
            if($file != '.' && $file != '..'){

                if(time()- fileatime(session_save_path() . '\\' . $file) < MAX_IDLE_TIME * 60) {
                $count++;
}
}
closedir($directory_handle);

return $count;

}else {
return false; 
}
}
}

echo 'Number of online users: ' . getOnlineUsers() . '<br />';

/*?????  I guess $found should let it continue to the path it was already pointed at    ??????????*/


// check if count is good
  $found = false;
  foreach($count < 12) {
       $found = true;
}
if (!$found) {
    redirect("<meta http-equiv='refresh' content='0;url=http://www.google.com'>");
}

Name: Anonymous 2010-06-18 0:20

Good gracious, helping people who post PHP without the code tags. My, /prog/'s gone downhill.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List