Jump to content

Can't identify the parse error?


co.ador

Recommended Posts

have found this script php counter, but it is displaying a parse error on line 77 see the commented 77 line inside the script below. My limited eyes doesn't notice any parse error can you see any?

 

Thank you..

 

<?php  
session_start(); 

/* Define 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 != '..'){ 
// Comment the 'if(...){' and '}' lines if you get a significant amount of traffic 
if(time()- fileatime(session_save_path() . '\\' . $file) < MAX_IDLE_TIME * 60) { 
$count++; 
} 
} 
closedir($directory_handle); 

return $count; 

} 
else { // line 77 where the parse error is
return false; 
} 

} 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.