co.ador Posted November 8, 2009 Share Posted November 8, 2009 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 />'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/180778-cant-identify-the-parse-error/ Share on other sites More sharing options...
Alex Posted November 8, 2009 Share Posted November 8, 2009 You're missing a closing bracket '}' Quote Link to comment https://forums.phpfreaks.com/topic/180778-cant-identify-the-parse-error/#findComment-953730 Share on other sites More sharing options...
co.ador Posted November 8, 2009 Author Share Posted November 8, 2009 Thank you Alex i counted the brakets twice and i thought there were perfect but yes i missed the first if statment. Thank you.. PS: Two eyes can see better than one.. Quote Link to comment https://forums.phpfreaks.com/topic/180778-cant-identify-the-parse-error/#findComment-953733 Share on other sites More sharing options...
Alex Posted November 8, 2009 Share Posted November 8, 2009 I'd suggest getting a good PHP editor, they can match brackets and make things much easier. You can find a bunch in this topic: http://www.phpfreaks.com/forums/index.php/topic,54859.0.html Also, don't forget the mark the topic as solved, there's a button to do so in the bottom left. Quote Link to comment https://forums.phpfreaks.com/topic/180778-cant-identify-the-parse-error/#findComment-953737 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.