Greetings,
I have an ASP page that contains a form (form_login) with a Log In User server behavior. I used Dreamweaver CS3 to design the page. What I want to do upon a user's log in is to populate a date stamp in a field (LastLogin) within the user authentication table.
I know how to use hidden fields to write a date stamp to a field on an Update Record or Insert Record form, but I'm not sure how to accomplish the same in this scenario when the form submission doesn't submit to or update a table.
Any advice or resources anyone may have would be most appreciated.
Regards,
JM
2 3533
Hi there,
You need to create a bit of code that says: "If the user has authenticated themselves correctly, then UPDATE this date field to show the last time they logged in (i.e. now)", does that sound about right?
Basically, you'd do something like this: -
If blUserIsAuthenticated = True Then
-
Dim rsLoggedIn = Server.CreateObject("ADODB.Recordset")
-
Dim sqlLoggedIn = "UPDATE tbl_Users SET LastLoggedIn = NOW() WHERE Username = '" & strUsername & "'"
-
rsLoggedIn.Open sqlLoggedIn, objConn, 2, 3
-
'Then pass them to another page or whatever your app is doing.
-
Else
-
'Kick user
-
End If
-
This is assuming you have already created a connection object (objConn) to connect to your database and log your user in.
The principle is simple - set LastLoggedIn field to NOW() (SQL recognises this as the current date and time) where the username is equal to the username that has successfully logged in.
OR: If you're using inline SQL to log your user in (I hope you are using stored procedures!), then when you've created your recordset object, do this: -
If blUserIsAuthenticated = True Then
-
rsUser!LastLoggedIn = Now()
-
rsUser.Update
-
End If
-
Hope this helps.
medicineworker
I understand the concept of what you're talking about. Let me see if I can implement it. I'll post back if I have any issues (which I usually do).
Regards,
JM
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Gill Bates |
last post by:
I'm trying to login to a banking site
(https://www.providentconnection.com) using vb.net. I've tried many
variations of WebClient and HttpWebRequest; none of which I've got to
work. My latest version is:
Dim myWebClient As New WebClient
Dim nvc As New NameValueCollection
nvc.Add("Login", username)
nvc.Add("Password", password)
|
by: luscus |
last post by:
I am trying to device a formula so that when i check of a yes/no box
(done) it will automatically add the time in a field called "End
Time" and at the same time stamp the amount of minutes between a field
"begining Time" ( which already automatically stamps the time as you
enter a new record) and the field "end time"
For example : If I begun the new record at 2:45 PM worked on the
problem untill 3:00 PM and solved it. I would then...
|
by: Mike Hutton |
last post by:
Hi,
I have tried to keep things simple. Not simple enough, obviously.
I have a set of intranet ASP.NET pages which access a SQL back-end
through the normal SQLConnection stuff. I want to use peoples' NT
logons to user-stamp data changes made through the web-pages. So it
seemed obvious to use Windows authentication to access SQL
connections.
|
by: Gleep |
last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this.
The goal I don't want clients to give out their usernames and passwords to friends, since the site
relies on subscrption fees.
Sessions ID's are matched between the browser and the server. So a users can login with same
username and password and those sessions are tracked individually.
Some suggest create table fields with the session ID...
|
by: Ronald |
last post by:
I just started with dotnetnuke, and with a wrong login (wrong password
on a clean install i can crash the application pool from IIS.
(when i login with the right username/password information the site
works fine, i can do anything it is supposed to do)
I have the following setup:
-Windows 2003 x64 (fully patched, clean install)
-Dotnetframework 2.0.50727
-Dotnetnuke 4.3.1
| |
by: monomaniac21 |
last post by:
hi
i have a php site which allows users to save a cookie on their
computer which stores their user id details and allows them to auto-
login.
i'm wondering whether this is safe, is it possible for a malicious
user to find that cookie and change its value and therefore auto-login
as someone else? and if so how can this be prevented?
|
by: dgbergman |
last post by:
I have created a php login page in my site for my company. The goal is to get people into members area. Below is a list of steps that I take to create my login page in Dreamweaver CS3, can some one verify that I have built the page correct and that is nothing wrong with the code. If there is something wrong with the code is it possible to explain a step by step process to have a successful login page as I am new to creting php codes and pages in...
|
by: christian.siegl |
last post by:
Hello,
I need a buffer reinitialized approx. once in each second (I think
this is quite often). Now I think to do the reinit within a separate
thread (I am using boost::thread). Well, filling the buffer is a real
short task but must be done very often (at least once in a second).
So what is the guide line how often a thread should be created and how
long it should last???
|
by: dale5804 |
last post by:
hi.... i am used a tutorial found at...http://www.databasedev.co.uk/login.html... to create a login form. works fine, what i am wanting to do is on one of my forms, where data is entered i use the following code..
Private Sub InputData_Click()
If InputData.Caption = "Input New Notes" Then
NotesMemoField.Visible = True
NotesMemoField.SetFocus
InputData.Caption = "Add Data"
Else
If Len(NotesMemoField.Value) > 0 Then
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |