Tuesday, March 23, 2010

Display ALL login Users

i have made a instant messaging system on my site
http://gohbcc.com/CallCenter/LOGIN.asp
and would like to display the logged in users or be able to
identify if the users login name is actually logged in, i have a
table that records the successful logins and maybe a boolean column
in the database, or a server variable?Display ALL login Users
I麓m no ASP guy, but that麓s probably unrelated to
the server model -- I did something similar by first creating a
recordset using a query like...



SELECT login_name FROM user_table WHERE logged_in = 'Y'



Then open DW麓s Server Behaviour麓s Panel, click on
the + sign and select ''dynamic text'' -- in the next dialog you
should see an entry ''login_name'', that can be dragged/dropped into
the document. You麓d then simply need to highlight this
''object'' and apply a DW ''repeat region'' -- this will display all
users which match your queryDisplay ALL login Users
I can do the insert when they login, and show those records,
but how do i delete the record when they logout or the session
variable MM_Username expires? the logout is easy i can make a form
that deletes and is auto submited when they click logout, but what
about if the variable expires? how do i delete the record
then?
well, don麓t know if the required SQL for deleting a
recordset varies between server models -- I麓m on PHP and
don麓t want to give possibly wrong information for ASP.



However, you might reconsider your ''separate table'' approach,
because it麓s well possible to e.g. add two fields to the
user_table itself which will...



a) field 1 : insert ''Y'' on successful login, and set the
value to ''N'' on logout



b) field 2 : make it numeric, and add 1 everytime the user
logs in



just an idea to save you from having to delete records at all
;-)
I ended up making one column in the users table and setting
it to Yes/No value, and on login a direct to a page that
autosubmits the value 1 into the column, then on the page that
shows user login names with date password last updated i added a
column to show if active, if logged in it shows ''True'' if not
''False''. I also use it to allow instant messaging to any logged in
user, shows there login name in a drop-down, works really good,
except if the user doesnt log out,(closes browser) then they are
''True'' or still logged in. Any Ideas-

Thanks for the help. See it in action at:


http://www.gohbcc.com/CallCenter/LOGIN.asp

admin password on page also try:

username = foster

password = dog

..

username = calvin

password = cat

No comments:

Post a Comment