473,473 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to store login time and logout time for every user?

127 New Member
i wnat to store the login time and logout time in the database....

plz help... also how to retrieve stored logiin.logout times from database....

when i use the simple time disply
Expand|Select|Wrap|Line Numbers
  1. $t=time();
  2. echo ($t);
  3.  
i get result as
Expand|Select|Wrap|Line Numbers
  1. time 1287032030 
i want to display the time in a correct format like 10:58 AM ... how to do it plz help
Oct 14 '10 #1
3 8464
you can use session variable to store timings
Oct 15 '10 #2
kovik
1,044 Recognized Expert Top Contributor
No idea what ~sathishauit is trying to say, but I'd ignore it if I were you. lol

Anyway, it seems like you already know how to store the time, so what you need to be able to do now is to display it. Use the date() function to display the date in the format that you want.
Oct 15 '10 #3
oranoos3000
107 New Member
hello
you can create a table with column ip,time, type
ip is the user's ip
time is the time for login or logout time
type is 0 for login time and 1 for logout time

after login user , you can write a record in above table
user's ip is inside $_SERVER['REMOTE_ADDR'], current time is in time(), type depend on login or logout process

for logout you can a menu for logout or can use jquery and write a record in above table with type=1
current time an user's ip

be successful
Oct 16 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: MLH | last post by:
I have tblMemberLogins with and fields. Any member may appear in the table numerous times. How can I sum up the total time spent logged in by any member in the table, I can extract the records...
3
by: Joey Lee | last post by:
Hi, Does anyone knows how to control user login that only a single userid can login at a time? Thanks Joey
1
by: G | last post by:
Hello Friends, Can i find any sample free webbased-application for employee login and logout timing. Thanks in Advance Appreciate for your Help. Thanks G
0
by: G | last post by:
Hello Friends, Can i find any sample free webbased-application for employee login and logout timing. Thanks in Advance Appreciate for your Help. Thanks G
0
by: onlymukti4u | last post by:
Hi All, Can anyone help me out to get the code for knowing the login and logout time difference between some pages. What exactly I want is...."I have a small project having 5 pages,once the...
5
by: donaldmazig | last post by:
Hello, I am currently working in a database with user security level. What I want to add is a field in a form with type memo where all the user's name, login and logout date and time are recorded....
1
by: tariquetuku | last post by:
How to create a login and logout link in a php page which will affect the session variable? Any code available?
6
by: Thiago Macedo | last post by:
I could not find on the web a complete solution for this task. This is not the perfect solution, because it's doesn't have the ability to log the logout if browser crash or user leave it open while...
5
by: aajayaprakash | last post by:
<?php if($_GET) { $time_now=mktime(date('h')+5,date('i')+30); $a=date('h:i:s',$time_now); echo $b=date(m."/".d."/".Y); include("dbc.php");...
1
by: naveenkongati | last post by:
Hi, My application is designed under MVC2 architecture which includes JSP,Servlet,DAO and bean. In this application i am tracking a user login details into a table. When user logs out i am...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.