CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 NEED Date of Last Login Script

Print topic Send  topic

Author Message
GRQNET
Posted: 05/22/2003, 7:40 PM

Hi,
Can someone please help. I still can not get this to work right.

I'm a newbee.

I used the standard login screen that codecharge provides.
I created a new field in the database called "date_last_login" and I would
like to have that field get updated with the current date and time whenever
a user logs into the site.

My database is called: WTTMembership
The table is: members
The field is: date_last_login

Any help would be appreciated.
Thanks.

Anthony :)

HERE IS MY CODE SO FAR......

Function Login_DoLogin_OnClick() 'Login_DoLogin_OnClick @3-FA16D195

Dim Connection
Set Connection = New clsDBWTTMembership
Connection.Open

'Login @4-A0860347
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Connection.Execute "UPDATE members SET date_last_login = '" +
Cstr(now) + "'" + "WHERE MemberID = '" + .login.Value + "'"
Login_DoLogin_OnClick = True
End If
End With
'End Login

End Function 'Close Login_DoLogin_OnClick @3-54C34B28

GRQNET
Posted: 05/22/2003, 8:42 PM

Nevermind.... I figured it out....

In case anyone else needs this function, the final working code is as
follows:

My database is called: WTTMembership
The table is: members
The Login box on the login screen points to the "Member_Login" field.
The field that gets the date of last login is called: date_last_login


Function Login_DoLogin_OnClick() 'Login_DoLogin_OnClick @3-FA16D195

Dim Connection
Set Connection = New clsDBWTTMembership
Connection.Open

'Login @4-A0860347
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Connection.Execute "UPDATE members SET date_last_login = '" +
Cstr(now) + "'" + "WHERE Member_Login = '" + .login.Value + "'"
Login_DoLogin_OnClick = True
End If
End With
'End Login

End Function 'Close Login_DoLogin_OnClick @3-54C34B28





"GRQNET" <Webmaster@grq.net> wrote in message
news:bak1ma$765$1@news.codecharge.com...
> Hi,
> Can someone please help. I still can not get this to work right.
>
> I'm a newbee.
>
> I used the standard login screen that codecharge provides.
> I created a new field in the database called "date_last_login" and I would
> like to have that field get updated with the current date and time
whenever
> a user logs into the site.
>
> My database is called: WTTMembership
> The table is: members
> The field is: date_last_login
>
> Any help would be appreciated.
> Thanks.
>
> Anthony :)
>
> HERE IS MY CODE SO FAR......
>
> Function Login_DoLogin_OnClick() 'Login_DoLogin_OnClick @3-FA16D195
>
> Dim Connection
> Set Connection = New clsDBWTTMembership
> Connection.Open
>
> 'Login @4-A0860347
> With Login
> If NOT CCLoginUser(.login.Value, .password.Value) Then
> .Errors.addError("Login or Password is incorrect.")
> Login_DoLogin_OnClick = False
> .password.Value = ""
> Else
> If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
> Redirect = CCGetParam("ret_link", Empty)
> Connection.Execute "UPDATE members SET date_last_login = '" +
> Cstr(now) + "'" + "WHERE MemberID = '" + .login.Value + "'"
> Login_DoLogin_OnClick = True
> End If
> End With
> 'End Login
>
> End Function 'Close Login_DoLogin_OnClick @3-54C34B28
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.