|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: The Quickest Way To Count Users Online With PHP
The Quickest Way To Count Users Online With PHP If you have any comments or questions about this article then please post them here.
You can read the article here . |
|
#2
|
|||
|
|||
|
I would suggest using if(is_file($Fil)) instead of the method in the article becuase the way shown, I have add some errors. Over all the I thought the article was great!
|
|
#3
|
|||
|
|||
|
got Error
greeting,
got some errors my getOnlineUsers.php PHP Code:
my index.php PHP Code:
Last edited by sicksand : October 6th, 2002 at 11:27 PM. |
|
#4
|
|||
|
|||
|
What error messages are you receiving?
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#5
|
|||
|
|||
|
Parse error: parse error, unexpected T_ELSE in e:\homepage\shapik\vthree.0\getOnlineUsers.php on line 24
Fatal error: Call to undefined function: getonlineusers() in e:\homepage\shapik\vthree.0\index.php on line 12 |
|
#6
|
|||
|
|||
|
You're missing a closing brace "}" in your getOnlineUsers() function. I would suggest indenting your code, this way you can find errors like this more easily. It provides easier readability.
Try that. |
|
#7
|
|||
|
|||
|
hey everbody! i'm new here
and i was testing this script out and aready solved the missing bracket problem, but now i run into a new problem and where it supposed to say "users online: "it says Warning: open_basedir restriction in effect. File is in wrong directory in /mnt/host-users/cumnut/index.php on line 10 users online: any help? |
|
#8
|
|||
|
|||
|
this means that your having problems with setting the session data i think?? does your server allow sessions to be used?
|
|
#9
|
|||
|
|||
|
how do i find out if my server allows sessions?
i tried using phpinfo() and said phpinfo() was dispabled for security reasons... |
|
#10
|
|||
|
|||
|
sounds like its running in safe mode maybe?
|
|
#11
|
|||
|
|||
|
is their any way i can change that?
|
|
#12
|
|||
|
|||
|
well that depends if you have administrator rights to the actual web server? If your using a hosted web server, your got bugger all chance.
However, things will lookup if your running your own server look for "safe_mode" (without the quotes) in your php.ini file, and make sure that its set to "Off" (again without the quotes) save it, and restart the server. |
|
#13
|
|||
|
|||
i'm hosted!! well, worth a try anywayz....maybe i'll change the host... |
|
#14
|
|||
|
|||
|
Hi, first of all I'm sorry for my poor English.
The method described in the article is as great as simple but I would never suggest anybody to save sessions in files in a very busy site. In this case, as far as I know, it would be better saving sessions in dbm files or in a database. Have you ever tried, by any chance, to use your method on a dbm files based session system and count the keys instead of files? |
|
#15
|
|||
|
|||
|
Hey, dont know if anyone else has run into this problem, but fileatime() does not return the access TIME of the files on a Windows platform, only the date.
Not sure if there is a work around for this. Any ideas? I have already edited the script some what to only count session files that have certain values within them, so as to only count session files of registered members goes like this : PHP Code:
Wonder if adding a "last accessed date" to the session everytime it is accessed then pulling it out with any other values as above would solve this problem, or if it would slow everything down. Any help welcome. Thanks ![]() |
|
#16
|
|||
|
|||
|
lol.. Nevermind, created a work around. Just incase anyone else needs it... everytime you start the session: PHP Code:
then the script itself: PHP Code:
|