Results 1 to 4 of 4

Thread: Question about visitors online PHP script

  1. #1

    Question about visitors online PHP script

    I have this great PHP script to show how many people are currently visiting the page...
    But I want to know this:
    $db=mysql_connect("localhost","user","pass") or die(mysql_error());
    $time        = time();
    $clear_time  = $time - 600;
    $update_time = $time - 30;
    $ip          = $_SERVER['REMOTE_ADDR'];
    $onQuery = mysql_query("SELECT ip FROM c_online WHERE ip = '".$ip."' LIMIT 1") or die(mysql_error());
    $onCount = mysql_num_rows($onQuery);
    About the clear_time & update_time....

    If I want to make a longer session (instead of the time now)
    Do I need to raise the 600 & 30 or lower?
    As I see this $time MINUS 600...

    So normally I would raise it (for example to 6000), but as I see 'time' MINUS something it is maybe lowering it to 60 instead...

    Can someone help please?

    |Nico Lawsons

  2. #2
    It would help if you could share where those 2 variables are being used.


  3. $update_time is the time 30 seconds ago; $clear_time is the time 600 seconds ago.

    $update_time is used to tell the script how often to update the database.

    $clear_time is used to tell the script how long to consider a visitor as "current."

    Thinking this through... if you want to raise the apparent number of visitors, you would want to extend those times, right? So you would raise the 600 number.

    Test it and see this results. Practice trumps theory.

    Source: Number of visitors online system in PHP.

    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  4. #4
    Ow ok!
    Thanks a lot

    |Nico Lawsons

Similar Threads

  1. [WTS] Online TV Script
    By chandan in forum Scripts
    Replies: 2
    Last Post: 3 February, 2011, 01:09 AM
  2. @proxy script question
    By Habaku in forum Web Proxies
    Replies: 3
    Last Post: 31 December, 2010, 20:20 PM
  3. @Proxy Script Question
    By Zash in forum Proxy List Support Forum
    Replies: 7
    Last Post: 3 July, 2010, 09:35 AM
  4. [WTS] Online clipboard script! 5$
    By ruben in forum Scripts
    Replies: 0
    Last Post: 18 March, 2010, 04:34 AM
  5. another at proxy script question
    By in forum Proxy List Support Forum
    Replies: 6
    Last Post: 6 February, 2010, 03:44 AM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts