Quote:
Originally Posted by alexgeek
PHP-section?
If you have any code I might be able to edit it for you.
|
I can smell
php code alex... but I prefer
ASP 
I think, either way, the solution would be almost similar, right?
Quote:
Originally Posted by karinne
monie usually posts in the ASP section ... but he didn't specify so I left it here.
|
Ahh... you notice that

It's because I don't know if this is done with
asp or javascript or maybe
php. So I post it here. Could you move this thread to the
ASP section karinne, thanks.
Quote:
Originally Posted by AdRock
Ahh...i see
I was just thinking if you hadn't logged for a few days, how it knows when you last logged in
|
I use an update statement that capture todays date and time and update them in the database once the user log off..
Logout page:
- Code: Select all
<%
dim dd, mm, yyyy, newtime, newdate
dd=day(date)
if len(dd)=1 then
dd="0" & dd
end if
mm=month(date)
if len(mm)=1 then
mm="0" & mm
end if
yyyy=year(date)
'getting new date
newdate = dd & "-" & mm & "-" & yyyy
newtime = time()
%>
<%
Dim connectionString, rs, conn, user
user = Session("name")
connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=monieweb; UID=root;PASSWORD=monie;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open(connectionString)
Set rs = conn.Execute("UPDATE userlogin SET status = 'Offline', lastactivedate = '" & newdate & "', lastactivetime = '" & newtime & "' WHERE username = '" & user & "'")
Session.Abandon
Response.Redirect("default.asp")
%>
Greeting Page:
- Code: Select all
Welcome <%=rs("fullname")%>! Your last visit here is <%=rs("lastactivedate ")%> at <%=rs("lastactivetime ")%>