CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Date of last login

Print topic Send  topic

Author Message
GRQNET
Posted: 05/17/2003, 10:00 PM

I'm a newbee.

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

Anthony :)

DonB
Posted: 05/18/2003, 10:02 AM

Look at the login page you created. In the "code" tab, there will be two
parts - the main code page and the "events" code page (which has a file name
ending with "_events").

In the events code page, there will be an event for the login button, named
"Login_Button_DoLogin_OnClick()". There is an If statement that checks for
successful login. You can add one line of code there to execute an "update"
of the user table to set the DateOfLastLogin:

DBconnection1.Execute "UPDATE User SET DateOfLastLogin = '" + Cstr(now) +
"'"

My assumption is the connection you created was named "connection1" (the
default name CCS will assign it).

This example is ASP 3.0 code. You will have to extrapolate from this if you
use a different language. But it wil work the same in any language.

DonB


"GRQNET" <Webmaster@grq.net> wrote in message
news:ba741o$tlk$1@news.codecharge.com...
> I'm a newbee.
>
> I used the standard login screen that codecharge provides.
> I created a new field in the database called "DateOfLastLogin" and I would
> like to have that field get updated with the current date and time
whenever
> a user logs into the site.
> Any help would be appreciated.
> Thanks.
>
> Anthony :)
>
>

GRQNET
Posted: 05/18/2003, 8:00 PM

Thank you!!!
After some minor mods as you suggested it worked!!!!
Thanks again!!!



"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:ba8eb6$q4c$1@news.codecharge.com...
> Look at the login page you created. In the "code" tab, there will be two
> parts - the main code page and the "events" code page (which has a file
name
> ending with "_events").
>
> In the events code page, there will be an event for the login button,
named
> "Login_Button_DoLogin_OnClick()". There is an If statement that checks
for
> successful login. You can add one line of code there to execute an
"update"
> of the user table to set the DateOfLastLogin:
>
> DBconnection1.Execute "UPDATE User SET DateOfLastLogin = '" + Cstr(now) +
> "'"
>
> My assumption is the connection you created was named "connection1" (the
> default name CCS will assign it).
>
> This example is ASP 3.0 code. You will have to extrapolate from this if
you
> use a different language. But it wil work the same in any language.
>
> DonB
>
>
> "GRQNET" <Webmaster@grq.net> wrote in message
>news:ba741o$tlk$1@news.codecharge.com...
> > I'm a newbee.
> >
> > I used the standard login screen that codecharge provides.
> > I created a new field in the database called "DateOfLastLogin" and I
would
> > like to have that field get updated with the current date and time
> whenever
> > a user logs into the site.
> > Any help would be appreciated.
> > Thanks.
> >
> > Anthony :)
> >
> >
>
>

GRQNET
Posted: 05/18/2003, 8:14 PM

I have to take back that last reply.
I must have done something wrong.
Instead of just updating the one user's information, it is updating ALL the
"date_last_login" for all the records for all the users.

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

Here is my code:

Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick
@3-ADB4691A

Dim Connection
Set Connection = New clsDBWTTMembership
Connection.Open

'Login @4-AA430BB1
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_Button_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)
+ "'"
Login_Button_DoLogin_OnClick = True
End If
End With
'End Login

End Function 'Close Login_Button_DoLogin_OnClick @3-54C34B28


Thanks again for your help.





================================================

"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:ba8eb6$q4c$1@news.codecharge.com...
> Look at the login page you created. In the "code" tab, there will be two
> parts - the main code page and the "events" code page (which has a file
name
> ending with "_events").
>
> In the events code page, there will be an event for the login button,
named
> "Login_Button_DoLogin_OnClick()". There is an If statement that checks
for
> successful login. You can add one line of code there to execute an
"update"
> of the user table to set the DateOfLastLogin:
>
> DBconnection1.Execute "UPDATE User SET DateOfLastLogin = '" + Cstr(now) +
> "'"
>
> My assumption is the connection you created was named "connection1" (the
> default name CCS will assign it).
>
> This example is ASP 3.0 code. You will have to extrapolate from this if
you
> use a different language. But it wil work the same in any language.
>
> DonB
>
>
> "GRQNET" <Webmaster@grq.net> wrote in message
>news:ba741o$tlk$1@news.codecharge.com...
> > I'm a newbee.
> >
> > I used the standard login screen that codecharge provides.
> > I created a new field in the database called "DateOfLastLogin" and I
would
> > like to have that field get updated with the current date and time
> whenever
> > a user logs into the site.
> > Any help would be appreciated.
> > Thanks.
> >
> > Anthony :)
> >
> >
>
>

DonB
Posted: 05/19/2003, 6:20 AM

Sorry, I did not show the where clause: "WHERE UserID = '" + Login.Value +
"'"
in my previous reply.

Don


"GRQNET" <Webmaster@grq.net> wrote in message
news:ba9i6k$719$1@news.codecharge.com...
> I have to take back that last reply.
> I must have done something wrong.
> Instead of just updating the one user's information, it is updating ALL
the
> "date_last_login" for all the records for all the users.
>
> My database is called: WTTMembership
> The table is: members
> The field is: date_last_login
>
> Here is my code:
>
> Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick
> @3-ADB4691A
>
> Dim Connection
> Set Connection = New clsDBWTTMembership
> Connection.Open
>
> 'Login @4-AA430BB1
> With Login
> If NOT CCLoginUser(.login.Value, .password.Value) Then
> .Errors.addError("Login or Password is incorrect.")
> Login_Button_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)
> + "'"
> Login_Button_DoLogin_OnClick = True
> End If
> End With
> 'End Login
>
> End Function 'Close Login_Button_DoLogin_OnClick @3-54C34B28
>
>
> Thanks again for your help.
>
>
>
>
>
> ================================================
>
> "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
>news:ba8eb6$q4c$1@news.codecharge.com...
> > Look at the login page you created. In the "code" tab, there will be
two
> > parts - the main code page and the "events" code page (which has a file
> name
> > ending with "_events").
> >
> > In the events code page, there will be an event for the login button,
> named
> > "Login_Button_DoLogin_OnClick()". There is an If statement that checks
> for
> > successful login. You can add one line of code there to execute an
> "update"
> > of the user table to set the DateOfLastLogin:
> >
> > DBconnection1.Execute "UPDATE User SET DateOfLastLogin = '" + Cstr(now)
+
> > "'"
> >
> > My assumption is the connection you created was named "connection1" (the
> > default name CCS will assign it).
> >
> > This example is ASP 3.0 code. You will have to extrapolate from this if
> you
> > use a different language. But it wil work the same in any language.
> >
> > DonB
> >
> >
> > "GRQNET" <Webmaster@grq.net> wrote in message
> >news:ba741o$tlk$1@news.codecharge.com...
> > > I'm a newbee.
> > >
> > > I used the standard login screen that codecharge provides.
> > > I created a new field in the database called "DateOfLastLogin" and I
> would
> > > like to have that field get updated with the current date and time
> > whenever
> > > a user logs into the site.
> > > Any help would be appreciated.
> > > Thanks.
> > >
> > > Anthony :)
> > >
> > >
> >
> >
>
>

Eddy - IntraManga
Posted: 05/22/2003, 11:51 AM

Anybody has some code for this in php+mysql :-)
Thanks,



"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:baalmk$jqm$1@news.codecharge.com...
> Sorry, I did not show the where clause: "WHERE UserID = '" + Login.Value +
> "'"
> in my previous reply.
>
> Don
>
>
> "GRQNET" <Webmaster@grq.net> wrote in message
>news:ba9i6k$719$1@news.codecharge.com...
> > I have to take back that last reply.
> > I must have done something wrong.
> > Instead of just updating the one user's information, it is updating ALL
> the
> > "date_last_login" for all the records for all the users.
> >
> > My database is called: WTTMembership
> > The table is: members
> > The field is: date_last_login
> >
> > Here is my code:
> >
> > Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick
> > @3-ADB4691A
> >
> > Dim Connection
> > Set Connection = New clsDBWTTMembership
> > Connection.Open
> >
> > 'Login @4-AA430BB1
> > With Login
> > If NOT CCLoginUser(.login.Value, .password.Value) Then
> > .Errors.addError("Login or Password is incorrect.")
> > Login_Button_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)
> > + "'"
> > Login_Button_DoLogin_OnClick = True
> > End If
> > End With
> > 'End Login
> >
> > End Function 'Close Login_Button_DoLogin_OnClick @3-54C34B28
> >
> >
> > Thanks again for your help.
> >
> >
> >
> >
> >
> > ================================================
> >
> > "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
> >news:ba8eb6$q4c$1@news.codecharge.com...
> > > Look at the login page you created. In the "code" tab, there will be
> two
> > > parts - the main code page and the "events" code page (which has a
file
> > name
> > > ending with "_events").
> > >
> > > In the events code page, there will be an event for the login button,
> > named
> > > "Login_Button_DoLogin_OnClick()". There is an If statement that
checks
> > for
> > > successful login. You can add one line of code there to execute an
> > "update"
> > > of the user table to set the DateOfLastLogin:
> > >
> > > DBconnection1.Execute "UPDATE User SET DateOfLastLogin = '" +
Cstr(now)
> +
> > > "'"
> > >
> > > My assumption is the connection you created was named "connection1"
(the
> > > default name CCS will assign it).
> > >
> > > This example is ASP 3.0 code. You will have to extrapolate from this
if
> > you
> > > use a different language. But it wil work the same in any language.
> > >
> > > DonB
> > >
> > >
> > > "GRQNET" <Webmaster@grq.net> wrote in message
> > >news:ba741o$tlk$1@news.codecharge.com...
> > > > I'm a newbee.
> > > >
> > > > I used the standard login screen that codecharge provides.
> > > > I created a new field in the database called "DateOfLastLogin" and I
> > would
> > > > like to have that field get updated with the current date and time
> > > whenever
> > > > a user logs into the site.
> > > > Any help would be appreciated.
> > > > Thanks.
> > > >
> > > > Anthony :)
> > > >
> > > >
> > >
> > >
> >
> >
>
>

chrmu
Posted: 05/24/2003, 2:33 AM

$query = "... where UserID = '".CCGetUserID()."'";
$db1 = new clsDBConnection1();
$db1->query($query);

Christian

"Eddy - IntraManga" <eddy@intramanga.com> schrieb im Newsbeitrag
news:baj685$c26$1@news.codecharge.com...
> Anybody has some code for this in php+mysql :-)
> Thanks,
>
>
>
> "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
>news:baalmk$jqm$1@news.codecharge.com...
> > Sorry, I did not show the where clause: "WHERE UserID = '" + Login.Value
+
> > "'"
> > in my previous reply.
> >
> > Don
> >
> >
> > "GRQNET" <Webmaster@grq.net> wrote in message
> >news:ba9i6k$719$1@news.codecharge.com...
> > > I have to take back that last reply.
> > > I must have done something wrong.
> > > Instead of just updating the one user's information, it is updating
ALL
> > the
> > > "date_last_login" for all the records for all the users.
> > >
> > > My database is called: WTTMembership
> > > The table is: members
> > > The field is: date_last_login
> > >
> > > Here is my code:
> > >
> > > Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick
> > > @3-ADB4691A
> > >
> > > Dim Connection
> > > Set Connection = New clsDBWTTMembership
> > > Connection.Open
> > >
> > > 'Login @4-AA430BB1
> > > With Login
> > > If NOT CCLoginUser(.login.Value, .password.Value) Then
> > > .Errors.addError("Login or Password is incorrect.")
> > > Login_Button_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)
> > > + "'"
> > > Login_Button_DoLogin_OnClick = True
> > > End If
> > > End With
> > > 'End Login
> > >
> > > End Function 'Close Login_Button_DoLogin_OnClick @3-54C34B28
> > >
> > >
> > > Thanks again for your help.
> > >
> > >
> > >
> > >
> > >
> > > ================================================
> > >
> > > "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
> > >news:ba8eb6$q4c$1@news.codecharge.com...
> > > > Look at the login page you created. In the "code" tab, there will
be
> > two
> > > > parts - the main code page and the "events" code page (which has a
> file
> > > name
> > > > ending with "_events").
> > > >
> > > > In the events code page, there will be an event for the login
button,
> > > named
> > > > "Login_Button_DoLogin_OnClick()". There is an If statement that
> checks
> > > for
> > > > successful login. You can add one line of code there to execute an
> > > "update"
> > > > of the user table to set the DateOfLastLogin:
> > > >
> > > > DBconnection1.Execute "UPDATE User SET DateOfLastLogin = '" +
> Cstr(now)
> > +
> > > > "'"
> > > >
> > > > My assumption is the connection you created was named "connection1"
> (the
> > > > default name CCS will assign it).
> > > >
> > > > This example is ASP 3.0 code. You will have to extrapolate from
this
> if
> > > you
> > > > use a different language. But it wil work the same in any language.
> > > >
> > > > DonB
> > > >
> > > >
> > > > "GRQNET" <Webmaster@grq.net> wrote in message
> > > >news:ba741o$tlk$1@news.codecharge.com...
> > > > > I'm a newbee.
> > > > >
> > > > > I used the standard login screen that codecharge provides.
> > > > > I created a new field in the database called "DateOfLastLogin" and
I
> > > would
> > > > > like to have that field get updated with the current date and time
> > > > whenever
> > > > > a user logs into the site.
> > > > > Any help would be appreciated.
> > > > > Thanks.
> > > > >
> > > > > Anthony :)
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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