This is a discussion on "Display User Status?" within the Classic ASP section. This forum, and the thread "Display User Status? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Display User Status?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Display User Status?
Hello everybody....
Its been so long since I tried to know the method used to display the status of the user that are currently online. Is if involves a compleks programming to do this? I am developing an INTRANET web system for my university. I want to display the status of each user that have Registered/Logged On to the system by displaying the ONLINE or OFFLINE status. Just like webforumz have used... I have a page that will display all the list of the registered user, at the end of each row, i want to display the ONLINE of OFFLINE status! Can anybody give me a lecture on this...lol
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
|
|
||||
|
Hi monie...
This will involve having an extra field in your database... something like member_LastActive. Every time they hit a page on the intranet, you should update the field with the current date/time (use the now() function). On you members page, you can simply query this field for each member... if the value is less than 10 or 15 minutes ago (or whatever period you think) then the user is online. Hope this makes sense.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Hemm......
I dont really understand the method! If you have time, can you explain it to me further more Thanx Rob.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
How does a user login right now?? He/she fills in a form and submits it right? You check the details he/she provided and validate them against your database..... right?
When displaying a page, how do you make sure you only show it to a member?
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Ok...let me start!
First of all, because my system will be used by quiet small numbers of user and for security purpose, the admin will provide a username and password to the user (in my case the lecturer, the only user to my system) The information of the user (username & password) will be kept inside a database called userList.mdb When they get their password and their username, they can logon to the system. All the validation I have successfully done. (Invalid user, invalid password, invalid username...) After they have successfully logged on to the system, there is a page where they can post their comment or complaint and later it will be display just like what webforumz do(like this page so...do you follow me thank for helping me Rob
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Everytime the lecturer hits a page, are you checking it IS in fact the lecturer? In other words, do you check for a valid login on each page he hits?
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Hai Rob,
Actually I dont really understand what you really mean. Basically, once the lecturer has logged on to the system, they can go to any other page that i have provided. The only reason I provide the login is basically to avoid any student that are trying to access the system and them make any room reservation purposely. (my system is about ROOM RESERVATION) Did you ask me for that Q?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
<blockquote id="quote" class="ffs">quote:<hr height="1" noshade="noshade" id="quote" />Basically, once the lecturer has logged on to the system, they can go to any other page that i have provided.<hr height="1" noshade="noshade" id="quote" /></blockquote id="quote">This is what I am talking about. When you say they can go to any other page, how does that 'other' page MAKE SURE it is the lecturer, instead of someone just guessing the URL ?
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Ohhh...
Actually, i dont have that! Is it a session variable? I didn't think of it before...! So, that means, when the student remember the lecturer url page (the url address after they have successfully logged on), they can just type the url, and they can access the system! Oh my god! This is a big trouble for me...! Can you help me Rob?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
the check you are performing to make sure the lecturer entered the right login details.....
just make sure the same check is performed on each page. Store the credentials in either session vars, or a cookie..... and request them on each page to compare to the database. There are of course many other ways of implementing security.... better security, but for an intranet I think this should suffice.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Hai Rob...well actually, I have put this code on the top of my page so that any invalid user cannot get into the system without going through the login process.
Actually, I dont know the capability of this code that can detect any invalid user until I tried them just now!(entering the url) When they type any url from the system, they will be redirect to session_ended.asp page So...I have solve my problem! Can we proceed with our DISPLAY USER STATUS discussion...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
Ok, now I have the REQUIRED information, I can proceed to help you.
The code you posted would need to be amended a little to make this work, so something like this should suffice.... note, I use pseudo code, and not real code... I make the assumption that you have a database and know how to connect.
On the page where you want to show the online status, simply request the last active field..... if it falls between 10 or 20 minutes (or whatever you decide) of the current time, then it is assumed your lecturer is online. I hope this helps you.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
<blockquote id="quote" class="ffs">quote:<hr height="1" noshade="noshade" id="quote" />
' Code to connect to the Database and update ' a 'Last Active' field with the current date and time <hr height="1" noshade="noshade" id="quote" /></blockquote id="quote"> I am lost at this part Rob:mad:
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
here you have to connect to the database (you obviously know how to do that because you've done it before) and use an insert statement to add the current date and time into a field in the database called something like LastActive eg:
|
|
|||
|
<blockquote id="quote" class="ffs">quote:<hr height="1" noshade="noshade" id="quote" />
date = Now() "INSERT INTO lecturers (LastActive) VALUES (date) WHERE lecturerid='" & lecturerid & "'" <hr height="1" noshade="noshade" id="quote" /></blockquote id="quote"> Ok... LastActive is the field in my database to store the time..right? What about this: lecturerid='" & lecturerid & "'"? I dont understand the bolded part! is it the unique or primary key for the lecturer? After I have success doing that, What about the code to display the user status (ONLINE @ OFFLINE) I dont know how to request them from the database?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
to check who the lecturer signing in is, you must have a field in your database with the lecturers name or id? if so, then that is the record that you want to update with the time, right? so you must have some way of knowing what lecturer is signed in, then adding that value to the WHERE part of the statement so the database knows which record to update...
i have also just realised it needs to be an update statement:
|
|
||||
|
Monie....
You appear to be getting stuck on VERY basic things... whilst we are obviously going to continue helping you, you really should in addition, buy a book! This will serve as an invaluable tool for 'the basics'
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Hai benbacardi...
I have been trying to do this code but I cannot make it works! Could you help debugging the code...I dont know if the code is in the correct syntax or not! I place this code at the top of all my page to check an invalid user that are trying to access the page without logging in! When they are success, I want to update a field to store the current time ("LastActive" field) When the user login, I ask for their Username and password! and then, reffering to this username, update the LastActive field!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
![]() |
| Tags |
| display, user, status |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Status of IE | cedric813 | JavaScript Forum | 1 | Oct 21st, 2007 17:38 |
| [SOLVED] Show "Image" Depends On User "Status"? | Monie | Classic ASP | 6 | Oct 16th, 2007 01:22 |
| [SOLVED] User Last Visit Status | Monie | Classic ASP | 3 | Oct 10th, 2007 03:03 |
| Status Bar Display | Brakers | Starting Out | 0 | Jul 22nd, 2007 14:04 |