Chris
|
| Posted: 03/05/2002, 12:05 PM |
|
|
|
|
 |
Chris
|
| Posted: 03/05/2002, 12:06 PM |
|
Hi Ken,
Thanks for this code... I had to make a few changes because my USERS table is called MEMBERS but otherwise everything is the same. I placed it in the ON LOGIN event part of the login FORM (of the login page)... the code is working because it changing my database, but I"m getting the following error (any ideas???):
update MEMBERS set last_login_date = now , login_count = login_count + 1 where member_login= 'admin'
Response object error 'ASP 0156 : 80004005'
Header Error
/portal/Login.asp, line 155
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
|
|
|
 |
me again
|
| Posted: 03/05/2002, 12:50 PM |
|
Add the code below to your After-Login Event
Table = Users
Field for Login ID = Login
Field for login date = Login_Date
Also, added count field to keep track of times logged in
Login_Count
This executes only if login/password are valid..if bpassed= 0
The sLogin is temporary variable of loginid entered.
'***********************************************************************
if bPassed > 0 then
sWhere = "Login= " & toSQL(sLogin,"Text")
sSQL = "update USERS set " & _
"LOGIN_DATE = now " & _
",LOGIN_COUNT = LOGIN_COUNT + 1 "
sSQL = sSQL & " where " & sWhere
response.write sSQL
cn.execute sSQL
end if
|
|
|
 |
Ken Hardwick
|
| Posted: 03/05/2002, 1:57 PM |
|
Your "Header error" message is due to the "Response.write sSQL" statement.
I had had that in there as I was developing my code..it should be taken out.
if bPassed > 0 then
sWhere = "Login= " & toSQL(sLogin,"Text")
sSQL = "update USERS set " & _
"LOGIN_DATE = now " & _
",LOGIN_COUNT = LOGIN_COUNT + 1 "
sSQL = sSQL & " where " & sWhere
'***********************************response.write sSQL
cn.execute sSQL
end if
|
|
|
 |
|