simple who's online script i wanna listen others advice

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kty1104
Forum Newbie
Posts: 1
Joined: Thu Oct 29, 2009 3:54 am

simple who's online script i wanna listen others advice

Post by kty1104 »

hi i try to make simple who's online php script
i fomulate a plan for that
the plan is this
two person enterd
both two thread write the ip and time to the server's txt file
each tread read that file so both can see each other
one person exited
thread is end as soon as the person is exited that couldnt delete the data from its person's thread
so delete old time data in another person's thread using time information
read the file line by line and delete the data which far away from now(maybe 1sec)
join the the line user<br/>user<br/>user<br/>
echo the line

but i donno why alivelist(in the main)is blinking and my server uses very many resource and alivelist out nothing in other computer or blinking and stop
i wanna to listen adivse thx in advanced
i attach the main.php and alive.php with zipped(less than 2kb)
Attachments
alive.zip
(1.31 KiB) Downloaded 2 times
AlanG
Forum Contributor
Posts: 136
Joined: Wed Jun 10, 2009 1:03 am

Re: simple who's online script i wanna listen others advice

Post by AlanG »

A post I made before may help you.

viewtopic.php?f=1&t=105771
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: simple who's online script i wanna listen others advice

Post by josh »

Log traffic to a table on every page request, then select the count() of the distinct() `ip` from this table.
Post Reply