Tonka Posted April 13, 2008 Share Posted April 13, 2008 i use this on my login page but it can be put anywhere in login.php find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. add above You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then put this wherever you want to display the info You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Knuckles25 Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users Thanks Mate I Have Being Trying To Do Something Like This For My Game But Never Could Quote Link to comment Share on other sites More sharing options...
Tonka Posted April 13, 2008 Author Share Posted April 13, 2008 Re: online/offline/total users no prob, i actually had nyna help me with this Quote Link to comment Share on other sites More sharing options...
danger boy Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users Anyone got a screenshot? Quote Link to comment Share on other sites More sharing options...
danger boy Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users screenshot? Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users Erm, you really don't need a screenie for this... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users Im sure thats quite alot of queries. I use this: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users 2 queries in each case - count them However, your version buffers the entire dataset of users, whereas mine just returns a simple integer. Try running EXPLAIN SELECT * FROM users; vs. EXPLAIN SELECT COUNT(userid) FROM users; in phpMyAdmin... EXPLAIN can reveal lots about queries, and give you clues on how to optimize them. Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users Yes but still ok you could also use: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users Nope, that will always return 1 Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 13, 2008 Share Posted April 13, 2008 Re: online/offline/total users Meh i do it my way you do it your way OK?! Quote Link to comment Share on other sites More sharing options...
Halo Posted April 14, 2008 Share Posted April 14, 2008 Re: online/offline/total users Nice one Tonka Quote Link to comment Share on other sites More sharing options...
Tonka Posted April 14, 2008 Author Share Posted April 14, 2008 Re: online/offline/total users no prob Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted April 17, 2008 Share Posted April 17, 2008 Re: online/offline/total users Ooooo. I wouldn't get pissy with Nyna if I were you.. I did that once - still regret it to this day.. Meh i do it my way you do it your way OK?! Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 18, 2008 Share Posted April 18, 2008 Re: online/offline/total users And why's that? I dont run to her to get her to help me to code everything. I have only asked for "HER" help "ONCE" and thats it. Quote Link to comment Share on other sites More sharing options...
Vyp3r2oo9 Posted April 18, 2008 Share Posted April 18, 2008 Re: online/offline/total users :-o :-o :-o Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted April 18, 2008 Share Posted April 18, 2008 Re: online/offline/total users Well I can certainly confirm him asking me for assistance on one occasion... Anyway, this is getting totally off-topic. Personally I'd recommend that you never show any data like this on any public facing pages *unless* it is cached. otherwise your site is open to a number of fairly serious issues. Quote Link to comment Share on other sites More sharing options...
mdshare Posted April 20, 2008 Share Posted April 20, 2008 Re: online/offline/total users Guess I gonna reply with a small Users Online script that doesn't need MySQL. Not Tested It's a rude not accurate script, it fetches the IPs and if the same IP isn't listed within 10 minutes it ads it to the txt file. Now this is a basic example, including the echo, best would be to put the fetch IP into the header and the echo at your login page. It should work allthough I'm still half asleep users.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. visitors.dat save a blank file with read/write access called visitors.dat Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted April 20, 2008 Share Posted April 20, 2008 Re: online/offline/total users I'll have a look at it and post a screen shot of it! Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted April 20, 2008 Share Posted April 20, 2008 Re: online/offline/total users It simply says: online and that's it xD Quote Link to comment Share on other sites More sharing options...
mdshare Posted April 20, 2008 Share Posted April 20, 2008 Re: online/offline/total users see never good when just awake if($users == 1) { echo("1 User online"); } else { echo("$users online"); } $users has to be $count Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted April 20, 2008 Share Posted April 20, 2008 Re: online/offline/total users You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. => 0 users online 1 user online 2 users online 3 users online 4 users online etc ;) Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted April 21, 2008 Share Posted April 21, 2008 Re: online/offline/total users And of course Nyna's works so yea.. xD Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted April 21, 2008 Share Posted April 21, 2008 Re: online/offline/total users You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. That right? Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted April 22, 2008 Share Posted April 22, 2008 Re: online/offline/total users No becausing you killing the <?php befor it should. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Could try that. Quote Link to comment 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.