Print Page | Close Window

Get User Names

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4673
Printed Date: 28 March 2026 at 2:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Get User Names
Posted By: s1mon
Subject: Get User Names
Date Posted: 01 August 2003 at 1:55pm

Hi,

If you have a database with a field saying UserID how can you say who is logged in to your site and display it on a page? like the forums do - i've tried to look but its  abit over my head - is there a way of doing it realy simply?




Replies:
Posted By: michael
Date Posted: 01 August 2003 at 2:43pm
You would have to write to something like an active users table if you just want to count logged in users. Simply do an insert to a table, have it updated on every page and if this updates finds users who have a lastupdatetime of let's say 20 min ago, scratch them.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Mart
Date Posted: 01 August 2003 at 3:21pm

Or you could set a cookie or session on the login page and use something like this:

if not request.cookies("userid") = "" Then

response.write request.cookies("userid")

Else

response.write "You are not logged in!"

End If



Posted By: pmormr
Date Posted: 01 August 2003 at 5:52pm

use the user counter on this site as an example, just modify that code to add to a database instead of incrementing an integer



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net