Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

PHP Tutorials: Count Visitors Currently Online (Part 3)

Loading...

Sign in or sign up now!
6,971
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 12, 2009

Visit the forum for help!
http://phpacademy.info/forum

Follow on Twitter!
http://twitter.com/phpacademy

Count how many visitors are currently browsing your website!

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (phpacademy)

  • Nice tutorial. It's working for me in the sense that it's counting the amount of sessions, but my folder is not deleting sessions when browser is closed. Any ideas? thanks.

  • At all? It should do, sometimes takes a while. Although I know how to write this code, I'm not sure of the workings behind it so maybe someone else would be able to help, try the forums if not!

  • you rock rock rock! thanks again!

  • You're totally welcome!

Top Comments

  • I love your tutorials. and there very helpfull.

    Hope you bring us manny more tutorials.

    Good luck to you.

see all

All Comments (19)

Sign In or Sign Up now to post a comment!
  • @pocak87

    Replace ereg function with: strstr($file, "sess")

  • Hello!

    THX for all tut, I've learnd lots of You, but now I'm getting an error. It says Deprecated: Function ereg() is deprecated. I really don't understand. Can anybody help me????

  • Baabai?

    What the feck was that about? XD

    Anyway, I tried this tut, did EVERYTHING you told me to, and the error I'm getting is a loop of ereg is deprecated. What can I do to solve this issue?

  • you rock alex! i wish you become a millionaire.

  • @phpacademy Yup, Alex, I just checked my TMP folder and there are 38 session files online. It says the same on my PHP script.

  • 496 people on my site... i don't think so...

  • Dosn't work to well when u have 12,000 past five mins.....Causes my server load to jump.

  • I get:

    Warning: readdir(): supplied argument is not a valid Directory resource

    For the while-loop.. Any way to fix this?

  • I think you need this: ini_set("session.cookie_lifeti­me", 0);

    Put it before session_start()! With this line, the user's session will be deleted when the browser closes.

  • you'll have to use PHP to store sessions, and to echo them out into a variable.

    thankfully, you can incorporate PHP w/HTML

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more