Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Is There A...

  1. #1
    Join Date
    Jul 2004
    Location
    Bournemouth. UK
    Posts
    3,638
    Tokens
    0

    Latest Awards:

    Default Is There A...

    Is there a PHP Script to show how many people are visiting your site at once? Rather than having to go to something like www.fastusersonline.com

    Online: 3

    For example ?

    Thanks ol:
    Last edited by iRoss; 20-05-2005 at 07:47 PM.
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  2. #2
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Yep, i use my forum to do it now, but previosly i used a free script downloaded from http://www.phponline.biz/
    for both uses online now, and usersonline today

  3. #3
    Join Date
    Jul 2004
    Location
    Bournemouth. UK
    Posts
    3,638
    Tokens
    0

    Latest Awards:

    Default

    But i just want a php 1 No websites included?
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  4. #4
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    It is a php one. you download the script and upload it to your space

  5. #5
    Join Date
    Jul 2004
    Location
    Bournemouth. UK
    Posts
    3,638
    Tokens
    0

    Latest Awards:

    Default

    So it doesn't have to go 2 the site, Recieve it then come back to yours. Which then causes slow load times >=0

    And can i have some directions on where on the site to download it from?! :eusa_wall
    Last edited by iRoss; 20-05-2005 at 08:00 PM.

  6. #6
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    click the link labled users online script

    under free scripts

  7. #7
    Join Date
    Jul 2004
    Location
    Bournemouth. UK
    Posts
    3,638
    Tokens
    0

    Latest Awards:

    Default

    Lol i Have and it just gives a description of what it does... And thats it :-z
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  8. #8
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Its currantly loading up a blank page for me "/ problem with the site.

    search googles for a "php users online script"

  9. #9
    Join Date
    Jul 2004
    Location
    Bournemouth. UK
    Posts
    3,638
    Tokens
    0

    Latest Awards:

    Default

    Ahhhhh just my luck =( Thanks Anyway * Supposes he will have to wait till tomorrow *

    <?php
    // Configuration
    $dbhost = "localhost";
    $dbuser = "[to-add]"; // MySQL Username
    $dbpass = "[to-add]"; // MySQL Password
    $dbname = "[to-add]"; // Database Name
    $timeoutseconds = 1200; // length of session, 20 minutes is the standard

    $timestamp=time();
    $timeout=$timestamp-$timeoutseconds;
    $ip = substr($REMOTE_ADDR, 0, strrpos($REMOTE_ADDR,"."));

    // Connect to MySQL Database
    @mysql_connect($dbhost,$dbuser,$dbpass);
    @mysql_select_db($dbname) or die("No db");

    // Add this user to database
    $loopcap = 0;
    while ($loopcap && @mysql_query("insert into useronline values('$timestamp','$ip','$PHP_SELF')"))
    { // in case of collision
    $timestamp = $timestamp+$ip{0}; $loopcap++;
    }

    // Delete users that have been online for more then "$timeoutseconds" seconds
    @mysql_query("delete from useronline where timestamp<$timeout");

    // Select users online
    $result = @mysql_query("select distinct ip from useronline");
    $user = @mysql_num_rows($result);

    mysql_free_result($result);
    @mysql_close();

    // Show all users online
    if ($user==1) {echo $user.' user online';} else {echo $user.' users online';}
    ?>

    What you think of that 1 Mentor?
    Last edited by iRoss; 20-05-2005 at 08:15 PM.
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  10. #10
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Look good, athogh i tend to go for flat file stuff (reason unknown), it looks good. does it work?

Page 1 of 2 12 LastLast

Posting Permissions

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