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:
  #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: 6
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: 3
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: 6
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: 3
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!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

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




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek