Suggestions & Feedback
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsForum InformationSuggestions & Feedback

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 8th, 2002, 02:12 PM
skripty skripty is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 skripty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
More of a question!

Ok, firstly, i am about to open a new site for Web Programming.. http://www.xorf.creators.co.uk/. The URL does work. You have to wait a bit on the intro but you will get in after about 30 seconds.

The second thing is that i am wondering how you detect how many people are online and how you detect when they navigate away from your site.
My email is skript_kiddie@hotmail.com
thanks
skripty

Reply With Quote
  #2  
Old June 11th, 2002, 11:20 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: More of a question!

uhm.. hm.. log IP's into a txt file, have them expire after so long.. count the IP's in the txt file to know how many viewers are online.

there's probably an easier way to do it.

Reply With Quote
  #3  
Old June 13th, 2002, 05:58 PM
greggory greggory is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Reims, France
Posts: 82 greggory User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: More of a question!

That's the way it works, except that a DB is more efficiant than a file

Reply With Quote
  #4  
Old June 14th, 2002, 06:12 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: More of a question!

i'm at the point that i don't GET db's.. it's like giving my money to a bank i dunno what the heck they're doing with it. i'd rather have my own personal safe "txt file" at least until i am in need of something more powerful..

Reply With Quote
  #5  
Old July 6th, 2002, 08:50 AM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: More of a question!

try something like this:
php Code:
Original - php Code
  1.  
  2. <?php
  3. //fill in some basic info
  4. $server = "localhost";
  5. $db_user = "username";
  6. $db_pass = "password";
  7. $database = "database";
  8. $timeoutseconds = 300;
  9.  
  10. //get the time
  11. $timestamp = time();
  12. $timeout = $timestamp-$timeoutseconds;
  13.  
  14. //connect to database
  15. mysql_connect($server, $db_user, $db_pass);
  16.  
  17. //insert the values
  18. $insert = mysql_db_query($database, "INSERT INTO useronline VALUES
  19. ('$timestamp','$REMOTE_ADDR','$PHP_SELF')");
  20. if(!($insert)) {
  21.      print "Useronline Insert Failed > ";
  22. }
  23.  
  24. //delete values when they leave
  25. $delete = mysql_db_query($database, "DELETE FROM useronline WHERE timestamp<$timeout");
  26. if(!($delete)) {
  27.     print "Useronline Delete Failed > ";
  28. }
  29.  
  30. //grab the results
  31. $result = mysql_db_query($database, "SELECT DISTINCT ip FROM useronline WHERE file='$PHP_SELF'");
  32. if(!($result)) {
  33.     print "Useronline Select Error > ";
  34. }
  35.  
  36. //number of rows = the number of people online
  37. $user = mysql_num_rows($result);
  38.  
  39.  
  40. //spit out the results
  41. if($user == 1) {
  42. print("$user user onlinen");
  43. } else {
  44. print("$user users onlinen");
  45. }
  46. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsForum InformationSuggestions & Feedback > More of a question!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway