very easy to do. just in case that sounded like complete
greek to you, I'll help put it into terms a beginner would
understand.
You can create a second page that actually compares users
against the DB, and on that page adds an update to the recordset if
that recordset is found (i.e. looks for matching username and
password, and if found updates a field in the table that you will
create that you will call lastlogin or similar), and then redirects
to protected area. If the username and password is not found,
redirects to your login err message indicating it's not a found
login.
On the login form:
<form name="form1" method="post"
action="thepagethathasthescript.asp">
On the script page, it will look something close to this:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="connections/yourconnectionname.asp"
-->
<%
dim username, password
username = session("username")
password = session("password")
set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_yourconnectionname_STRING
rs.Source = "SELECT * FROM Table WHERE username = '" +
Replace(username, "'", "''") + "'" & "AND Password = '" +
Replace(password, "'", "''") + "'"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
rs_numRows = 0
if rs.eof or rs.bof then
response.redirect "login.asp?err=true"
else
rs("LastLogin") = date()
rs.Update
response.redirect "secureareatheyaregoing.asp"
end if
%>
<%
rs.Close()
%>
code is not tested, but what do you want at 1AM off the top
of my head. that should at least give you a good head start. If you
would like us to do any work for you, you can also hire our design
firm. Check the link below.