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, 03: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 12th, 2002, 12:20 AM
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, 06: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, 07: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, 09: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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




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