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 January 28th, 2005, 02:48 AM
Authorized User
 
Join Date: Dec 2004
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ALEX_GRIM
Default is this user on/offline? boolean db entry?

ok, i built a website, well a few, but the one i'm asking a question
for is http://www.members.grimmusic.com . i want to add a feature that
will add a database entry to tell that you are online, well that's easy:

************************************************** ***************
sub page_load(etc..)

open oledb = "select from tablename.* where uname = '"& request.cookie("cookiename")("username") &"'......etc

update recordset("status") etc...........
************************************************** ***************
ok, so now they're officially, "online", lol, but how do they
offiacially go "offline"? you and i both know that noone "loggs off"
anymore, so i can't use that approach. now, i'd be using the page_load
event to log them on, and i could even use that everytime the load a
page, but how would i log them off? iv'e only been doing this for a
couple months, so i don't know all the tools to the trade, and the
tricks in using them, but i was messing with vb6 the other day,
teaching myself how to utilize the timer, very useful, can i use a
time in asp? if so, can i do it with vb script? i don't know java yet,
or c# or c++ or j#, just vb script. like i said, i'm two months old to
this stuff. thanks in advance for your time: ALEX GRIM, WWW.GRIMMUSIC.COM

GRIM@GRIMMUSIC.COM
WWW.GRIMMUSIC.COM
__________________
---------------------------
A Black sheep moves easy in the darkness.
GRIM@GRIMMUSIC.COM
WWW.GRIMMUSIC.COM
 
Old January 28th, 2005, 01:18 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Well, you can have a logoff function, but to detect when users close the browser, you have to write code for the session_end event. The session_end event is defined in the global.asa file, and quite honestly, I don't know if it fires everytime the user closes the browser, or how well it works and how "true" it is. With that said, you may not know completely. If you base it off of the SessionID, that might be a truer picture; associating a user to the sessionID. That way, when the log back in, if they are using a different sessionID, you know the other ones are wrong and can delete it. Or essentially store a field in the session for when the login, and that variable will go away when the session times out or when they navigate away from the site.

Brian
 
Old February 2nd, 2005, 04:36 PM
Authorized User
 
Join Date: Dec 2004
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ALEX_GRIM
Default

good idea, but how do i USE the session id exactly? would it be something like "response.write(sessionid)"? i mean, i KNOW i wouldn't use it in that manner, but is that what i'd call it by? actually, i don't think that would work either, because if i stored thier session id in the database, then it would never return a null value, it would simply be replaced each time they logged in. so i'm up for another option iguess, but thanks for trying to help dude.

GRIM@GRIMMUSIC.COM
WWW.GRIMMUSIC.COM
 
Old February 2nd, 2005, 04:39 PM
Authorized User
 
Join Date: Dec 2004
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ALEX_GRIM
Default

hey! right there! ok if you can tell me how wrox is telling their page to postpone a response.redirect after you make a post, i can do this! you ever notice that? when you post something, it shows you a confirmation page for about 2 secs, then redirects you back to your posted comment. there HAS to be a timer associated with asp!

GRIM@GRIMMUSIC.COM
WWW.GRIMMUSIC.COM
 
Old February 3rd, 2005, 09:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You use a meta tag for that actually, see http://www.i18nguy.com/markup/metatags.html#refresh.

Session ID is accessed through Session.SessionID, and you may want to make a table linking the session to the user. THen if the user has more than one entry, delete the other entries and add the new one.

Brian
 
Old February 3rd, 2005, 02:20 PM
Authorized User
 
Join Date: Dec 2004
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ALEX_GRIM
Default

hey, thanks a million, that is EXACTLY what i came for, but how would i use that session id in a query to the server, OR even an ip addy? what i'm asking is suppose i use the ip, and the entry for THEIR ip is 65.27.128.156, how would i ask my server if that ip is still connected? or if i use your session id,(wich i think is much more accurate), how would i, (after looking it up int he db), ask the server if Session.SessionID # 33445566 is still active? or would i even ask if it's active? would i ask if that session id id expired? etc? thanks.

GRIM@GRIMMUSIC.COM
WWW.GRIMMUSIC.COM
 
Old February 5th, 2005, 06:30 AM
Authorized User
 
Join Date: Dec 2004
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ALEX_GRIM
Default

IN CASE ANYONE IS STILL READING ON THIS TOPIC, I FOUND THE SOLOUTION FOR THIS ISSUE, AND HAVE POSTED IT ON MY FORUMS AT [LINK]HTTP://WWW.FORUMS.GRIMMUSIC.COM[/LINK], GO TO THE TECHNICAL FORUMS, IT'S ONE OF THE FIRST TOPIC THERE, CALLED THE SESSION_ONEND EVENT.

GRIM@GRIMMUSIC.COM
WWW.GRIMMUSIC.COM





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Multi User Order Entry Screen csjenkin1 VB Databases Basics 0 November 30th, 2007 04:29 PM
Forms or a solution for end user data entry? Scott B SQL Server 2005 0 October 19th, 2007 04:21 AM
Text Entry to Access DB hoffmann Access ASP 1 December 21st, 2003 07:42 PM
User Entry MrDannyP Beginning VB 6 2 December 3rd, 2003 10:22 PM





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