Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2004, 02:47 PM
Authorized User
 
Join Date: Jan 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to view how many users are on website...

I was just wondering if anyone knew if you could post how many users are online or on your website at the time that you are...It usually says something like "Users Online:(Number)" Is this possible with ASP or do I need another code to do this??? Thank you!

 
Old September 12th, 2004, 08:14 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Yes you can. What you need to look up is the 'application' object, this sits in a file called 'global.asa'. The global.asa must be named exactly this and sit in your web sites root.

This following link illustrates how to use (including code) the Application object to persist data across an ASP application. Items that are stored in the ASP intrinsic Application object are available to ALL ASP PAGES in the current application, as well as across ALL CURRENT SESSIONS.

http://support.microsoft.com/default...299683&SD=MSDN


Wind is your friend
Matt
 
Old September 12th, 2004, 10:25 PM
Authorized User
 
Join Date: Jan 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK...now, i have one of these files in another folder on the website that goes to a chat application...Is this going to interfere?

 
Old September 13th, 2004, 06:58 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

When you say one of those files
1.. is it called global.asa?
2.. is it in the web sites root dir where you want to put the 'visitor numbers' value?

I believe (99.9999% sure - perhaps someone else could jump in and confirm this) each web site can only have one global.asa file. If you have three web sites on your web server each needing a global.asa make each web site a virtual directory (IIS setting in the properties of each web site).

If the answer to Q 1 and 2 is yes, this is fine use the same file. A global.asa file can have as much functional code as you like, DB connections, hit counters, application counters, session timeout settings..... (do not attempt to write to a browser inside this file, it has no GUI)

HTH

Wind is your friend
Matt
 
Old September 17th, 2004, 12:20 PM
Authorized User
 
Join Date: Sep 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

as mat says, you can only have ONE global.asa file for EACH website, ie if you have multiple sites being hosted on the one machine (use IIS to check this) then each site can only access the ONE global.asa file. If you decide to go ahead with tracking user activity on ur site, please ensure that you do some reading up on GLOBAL.asa and the application object before jumping straight in.

Cheers



DJWright





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to view the website on IIS pabnix BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 December 19th, 2007 03:26 PM
MCMS 2002 website configuration for internet users gvkreddy General .NET 0 March 15th, 2006 10:09 AM
Show No. of users connected in website kudzuconf ASP.NET 1.0 and 1.1 Basics 1 March 13th, 2006 11:11 AM
open my PC to allow other users to view my wwwroot crmpicco HTML Code Clinic 2 July 3rd, 2005 03:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.